/*      */ package handling.channel.handler;
/*      */
/*      */ import client.MapleBuffStat;
/*      */ import client.MapleCharacter;
/*      */ import client.PlayerSpecialStats;
/*      */ import client.PlayerStats;
/*      */ import client.anticheat.CheatTracker;
/*      */ import client.anticheat.CheatingOffense;
/*      */ import client.inventory.Item;
/*      */ import client.inventory.MapleInventoryType;
/*      */ import client.inventory.MapleWeaponType;
/*      */ import client.skills.Skill;
/*      */ import client.skills.SkillFactory;
/*      */ import client.status.MonsterStatus;
/*      */ import client.status.MonsterStatusEffect;
/*      */ import configs.ServerConfig;
/*      */ import constants.GameConstants;
/*      */ import constants.ItemConstants;
/*      */ import constants.JobConstants;
/*      */ import constants.ServerConstants;
/*      */ import constants.SkillConstants;
/*      */ import constants.skills.*;
import handling.world.WorldBroadcastService;
/*      */ import handling.world.party.MaplePartyCharacter;
/*      */ import java.awt.Point;
/*      */ import java.awt.Rectangle;
/*      */ import java.util.*;
/*      */
/*      */
/*      */
/*      */
/*      */
/*      */ import org.apache.logging.log4j.LogManager;
/*      */ import org.apache.logging.log4j.Logger;
/*      */ import server.AutobanManager;
/*      */ import server.MapleStatEffect;
/*      */ import server.MapleStatEffectFactory;
/*      */ import server.life.Element;
/*      */ import server.life.MapleMonster;
/*      */ import server.life.MapleMonsterStats;
/*      */ import server.life.MobSkill;
import server.maps.MapleBlueSkySword;
/*      */ import server.maps.MapleMap;
/*      */ import server.maps.MapleMapObject;
/*      */ import server.maps.MapleMapObjectType;
/*      */ import server.maps.MapleMist;
/*      */ import server.maps.MapleSummon;
/*      */ import server.maps.pvp.MaplePvp;
/*      */ import server.skill.MapleForceAtom;
/*      */ import server.skill.MapleForceAtomFactory;
/*      */ import tools.AttackPair;
/*      */ import tools.DateUtil;
/*      */ import tools.MaplePacketCreator;
/*      */ import tools.Pair;
/*      */ import tools.Randomizer;
/*      */ import tools.Triple;
/*      */ import tools.data.input.LittleEndianAccessor;
/*      */ import tools.packet.BuffPacket;
/*      */ import tools.packet.EffectPacket;
/*      */ import tools.packet.ForcePacket;
/*      */ import tools.packet.MapleBlueSkySwordPacket;
/*      */ import tools.packet.MobPacket;
/*      */ import tools.packet.SummonPacket;
/*      */
/*      */ public class DamageParse {
    /*   49 */   private static final Logger log = LogManager.getLogger(DamageParse.class.getName());
    /*      */
    /*      */   public static void applyAttack(AttackInfo attack, Skill theSkill, MapleCharacter player, int attackCount, double maxDamagePerMonster, MapleStatEffect effect, int visProjectile) {
        /*   61 */     if (!player.isAlive() || player.isBanned()) {
            /*   62 */       player.getCheatTracker().registerOffense(CheatingOffense.ATTACKING_WHILE_DEAD, "操作者已死亡.");
            /*      */       return;
            /*      */     }
        /*   65 */     if (attack.real && SkillConstants.getAttackDelay(attack.skillId, theSkill) >= 50)
            /*   66 */       player.getCheatTracker().checkAttack(attack.skillId, attack.lastAttackTickCount);
        /*   69 */     if (attack.skillId != 0) {
            /*   70 */       if (effect == null) {
                /*   71 */         player.getClient().announce(MaplePacketCreator.enableActions());
                /*      */         return;
                /*      */       }
            /*   74 */       if (SkillConstants.isMulungSkill(attack.skillId)) {
                /*   75 */         if (player.getMapId() / 10000 != 92502)
                    /*      */           return;
                /*   79 */         if (player.getMulungEnergy() < 10000)
                    /*      */           return;
                /*   82 */         player.mulung_EnergyModify(false);
                /*   84 */       } else if (SkillConstants.isPyramidSkill(attack.skillId)) {
                /*   85 */         if (player.getMapId() / 1000000 != 926)
                    /*      */           return;
                /*   89 */         if (player.getPyramidSubway() == null || !player.getPyramidSubway().onSkillUse(player))
                    /*      */           return;
                /*   93 */       } else if (SkillConstants.isInflationSkill(attack.skillId)) {
                /*   94 */         if (player.getBuffedValue(MapleBuffStat.巨人药水) == null)
                    /*      */           return;
                /*   97 */       } else if (JobConstants.is魂骑士(player.getJob()) && player.getBuffedValue(MapleBuffStat.日月轮转) != null) {
                /*   98 */         int b = player.getSpecialStat().getMoonCycle();
                /*   99 */         int skillid = (b == 0) ? 11101022 : 11111022;
                /*  100 */         SkillFactory.getSkill(skillid).getEffect(player.getSkillLevel(skillid)).applyTo(player);
                /*  101 */       } else if (JobConstants.is神之子(player.getJob())) {
                /*  102 */         player.handle提速时刻();
                /*      */       }
            /*  105 */       int mobCount = effect.getMobCount(player);
            /*  106 */       if (player.getStatForBuff(MapleBuffStat.激素狂飙) != null)
                /*  107 */         mobCount += 5;
            /*  109 */       if (player.getTotalSkillLevel(1220010) > 0)
                /*  110 */         mobCount += SkillFactory.getSkill(1220010).getEffect(player.getTotalSkillLevel(1220010)).getTargetPlus();
            /*  112 */       if (attack.numAttacked > mobCount && attack.skillId != 1220010) {
                /*  113 */         player.getCheatTracker().registerOffense(CheatingOffense.MISMATCHING_BULLETCOUNT, "异常的攻击次数.");
                /*  114 */         if (player.isShowPacket())
                    /*  115 */           player.dropMessage(-5, "物理怪物数量检测 => 封包解析次数: " + attack.numAttacked + " 服务端设置次数: " + effect.getMobCount(player));
                /*      */         return;
                /*      */       }
            /*  119 */       player.setLastAttackSkillId(attack.skillId);
            /*      */     }
        /*  165 */     if (player.isShowPacket())
            /*  166 */       player.dropMessage(-1, "攻击动作: " + Integer.toHexString(attack.display) + " 攻击方向：" + Integer.toHexString(attack.direction) + " 攻击姿势：" + Integer.toHexString(attack.stance));
        /*  170 */     if (player.getStatForBuff(MapleBuffStat.光暗转换) != null || player.getStatForBuff(MapleBuffStat.影分身) != null || (player.getStatForBuff(MapleBuffStat.骑兽技能) != null && player.getStatForBuff(MapleBuffStat.骑兽技能).is美洲豹骑士())) {
            /*  171 */       attackCount *= 2;
            /*  172 */     } else if (player.hasBuffSkill(5321054)) {
            /*  173 */       attackCount *= 3;
            /*  174 */     } else if (player.getStatForBuff(MapleBuffStat.战斗大师) != null || player.getStatForBuff(MapleBuffStat.激素狂飙) != null) {
            /*  175 */       attackCount += 2;
            /*  176 */     } else if (attack.skillId == 15121001) {
            /*  177 */       attackCount += Math.min(player.getBuffedIntValue(MapleBuffStat.百分比无视防御) / 5, (player.getStat()).raidenCount);
            /*      */     }
        /*  182 */     boolean useAttackCount = !SkillConstants.isNoCheckAttackSkill(attack.skillId);
        /*  185 */     if (attack.numDamage > attackCount &&
                /*  186 */       useAttackCount) {
            /*  187 */       if (player.isShowPacket())
                /*  188 */         player.dropDebugMessage(3, "[攻击信息] 物理攻击次数出错 技能ID:" + attack.skillId + " 封包解析次数:" + attack.numDamage + " 实际次数:" + attackCount);
            /*  190 */       player.getCheatTracker().registerOffense(CheatingOffense.MISMATCHING_BULLETCOUNT, "异常的攻击次数.");
            /*  191 */       log.info("[作弊] " + player.getName() + " 物理攻击次数异常。 attack.hits " + attack.numDamage + " attackCount " + attackCount + " 技能ID " + attack.skillId);
            /*  192 */       if (ServerConstants.isShowGMMessage())
                /*  193 */         WorldBroadcastService.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(6, "[管理员信息] " + player.getName() + " ID: " + player.getId() + " (等级 " + player.getLevel() + ") 物理攻击次数异常。 attack.hits " + attack.numDamage + " attackCount " + attackCount + " 技能ID " + attack.skillId));
            /*      */       return;
            /*      */     }
        /*  200 */     if (attack.numDamage > 0 && attack.numAttacked > 0)
            /*  202 */       if (!player.getStat().checkEquipDurabilitys(player, -1)) {
                /*  203 */         player.dropMessage(5, "武器耐久度不足，无法进行攻击！");
                /*      */         return;
                /*      */       }
        /*  209 */     if (player.checkSoulWeapon() && attack.skillId == player.getEquippedSoulSkill())
            /*  210 */       player.checkSoulState(true);
        /*  214 */     if (player.getMap().isPvpMap()) {
            /*  215 */       MaplePvp.doPvP(player, player.getMap(), attack, effect);
            /*  216 */     } else if (player.getMap().isPartyPvpMap()) {
            /*  217 */       MaplePvp.doPartyPvP(player, player.getMap(), attack, effect);
            /*  218 */     } else if (player.getMap().isGuildPvpMap()) {
            /*  219 */       MaplePvp.doGuildPvP(player, player.getMap(), attack, effect);
            /*      */     }
        /*  224 */     long totalDamage = 0L;
        /*  225 */     long totDamageToOneMonster = 0L;
        /*  226 */     long monsterMaxHp = 0L;
        /*  227 */     long maxDamagePerHit = player.getMaxDamageOver(attack.skillId);
        /*  228 */     MapleMonster monster = null;
        /*  230 */     int lastKillMob = 0;
        /*  231 */     int lastKillMobExp = 0;
        /*  232 */     Map<Integer, Integer> killMobList = new LinkedHashMap<>();
        /*  233 */     boolean isUseSkillEffect = true;
        /*  236 */     boolean isCritDamage = false;
        /*  239 */     for (AttackPair oned : attack.allDamage) {
            /*  240 */       monster = player.getMap().getMonsterByOid(oned.objectid);
            /*  241 */       if (monster != null && monster.getLinkCID() <= 0) {
                /*  242 */         totDamageToOneMonster = 0L;
                /*  243 */         monsterMaxHp = monster.getMobMaxHp();
                /*  244 */         MapleMonsterStats monsterstats = monster.getStats();
                /*  245 */         int fixeddmg = monsterstats.getFixedDamage();
                /*  247 */         for (Pair<Long, Boolean> eachde : (Iterable<Pair<Long, Boolean>>)oned.attack) {
                    /*  248 */           if (((Boolean)eachde.right).booleanValue())
                        /*  249 */             isCritDamage = true;
                    /*  251 */           long eachd = ((Long)eachde.left).longValue();
                    /*  252 */           if (player.isShowPacket() && eachd > 0L)
                        /*  253 */             player.dropMessage(-1, "物理攻击打怪伤害 : " + eachd + " 服务端预计伤害 : " + maxDamagePerHit + " 是否超过 : " + ((eachd > maxDamagePerHit) ? 1 : 0) + " 是否爆击: " + eachde.right);
                    /*  255 */           if (fixeddmg != -1) {
                        /*  256 */             if (monsterstats.getOnlyNoramlAttack()) {
                            /*  257 */               eachd = (attack.skillId != 0) ? 0L : fixeddmg;
                            /*      */             } else {
                            /*  259 */               eachd = fixeddmg;
                            /*      */             }
                        /*  262 */           } else if (monsterstats.getOnlyNoramlAttack()) {
                        /*  263 */             eachd = (attack.skillId != 0) ? 0L : Math.min(eachd, maxDamagePerHit);
                        /*  264 */           } else if (!player.isGM()) {
                        /*  265 */             if (eachd > maxDamagePerHit && maxDamagePerHit > 2L) {
                            /*  266 */               player.getCheatTracker().registerOffense(CheatingOffense.HIGH_DAMAGE, "[伤害: " + eachd + ", 预计伤害: " + maxDamagePerHit + ", 怪物ID: " + monster.getId() + "] [职业: " + player.getJob() + ", 等级: " + player.getLevel() + ", 技能: " + attack.skillId + "]");
                            /*  267 */               if (attack.real)
                                /*  268 */                 player.getCheatTracker().checkSameDamage(eachd, maxDamagePerHit);
                            /*  270 */               if (eachd > maxDamagePerHit * 2L && attack.skillId != 4001344) {
                                /*  271 */                 String banReason = player.getName() + " 被系统封号.[异常攻击伤害值: " + eachd + ", 预计伤害: " + maxDamagePerHit + ", 怪物ID: " + monster.getId() + "] [职业: " + player.getJob() + ", 等级: " + player.getLevel() + ", 技能: " + attack.skillId + "]";
                                /*  272 */                 if (player.getLevel() < 10 && eachd >= 10000L) {
                                    /*  273 */                   AutobanManager.getInstance().autoban(player.getClient(), banReason);
                                    /*      */                   return;
                                    /*      */                 }
                                /*  276 */                 if (player.getLevel() < 20 && eachd >= 20000L) {
                                    /*  277 */                   AutobanManager.getInstance().autoban(player.getClient(), banReason);
                                    /*      */                   return;
                                    /*      */                 }
                                /*  280 */                 if (player.getLevel() < 30 && eachd >= 40000L) {
                                    /*  281 */                   AutobanManager.getInstance().autoban(player.getClient(), banReason);
                                    /*      */                   return;
                                    /*      */                 }
                                /*  284 */                 if (player.getLevel() < 50 && eachd >= 60000L) {
                                    /*  285 */                   AutobanManager.getInstance().autoban(player.getClient(), banReason);
                                    /*      */                   return;
                                    /*      */                 }
                                /*  288 */                 player.getCheatTracker().registerOffense(CheatingOffense.HIGH_DAMAGE_2, "[伤害: " + eachd + ", 预计伤害: " + maxDamagePerHit + ", 怪物ID: " + monster.getId() + "] [职业: " + player.getJob() + ", 等级: " + player.getLevel() + ", 技能: " + attack.skillId + "]");
                                /*      */               }
                            /*  291 */             } else if (eachd > maxDamagePerHit) {
                            /*  292 */               eachd = (int)maxDamagePerHit;
                            /*      */             }
                        /*      */           }
                    /*  297 */           totDamageToOneMonster += eachd;
                    /*  299 */           if ((eachd == 0L || monster.getId() == 9700021) && player.getPyramidSubway() != null)
                        /*  300 */             player.getPyramidSubway().onMiss(player);
                    /*      */         }
                /*  305 */         totalDamage += totDamageToOneMonster;
                /*  308 */         player.checkMonsterAggro(monster);
                /*  313 */         if (totDamageToOneMonster > 0L || attack.skillId == 1221011) {
                    /*  316 */           if (player.isBuffFrom(MapleBuffStat.刺客标记, SkillFactory.getSkill(4101011))) {
                        /*  318 */             Skill mskill = null;
                        /*  319 */             int mskillid = 0;
                        /*  320 */             int mskillevel = 0;
                        /*  321 */             MapleStatEffect effectSkill = null;
                        /*  323 */             if (player.getSkillLevel(SkillFactory.getSkill(4101011)) > 0) {
                            /*  324 */               mskillid = 4101011;
                            /*  325 */               mskill = SkillFactory.getSkill(4101011);
                            /*  326 */               mskillevel = player.getSkillLevel(SkillFactory.getSkill(4120018));
                            /*      */             }
                        /*  329 */             if (player.getSkillLevel(SkillFactory.getSkill(4120018)) > 0 || player.getSkillLevel(SkillFactory.getSkill(4120019)) > 0) {
                            /*  330 */               mskillid = 4120018;
                            /*  331 */               mskill = SkillFactory.getSkill(4120018);
                            /*  332 */               mskillevel = player.getSkillLevel(SkillFactory.getSkill(4120018));
                            /*      */             }
                        /*  334 */             for (MonsterStatusEffect s : monster.getAllBuffs()) {
                            /*  336 */               if ((s.getSkill() == 4101011 || s.getSkill() == 4110011 || s.getSkill() == 4120018 || s.getSkill() == 4120011) &&
                                    /*  337 */                 JobConstants.is隐士(player.getJob()))
                                /*  339 */                 if (attack.skillId != 0 && visProjectile > 0) {
                                    /*  340 */                   isUseSkillEffect = false;
                                    /*  341 */                   player.handleAssassinStack(monster, visProjectile);
                                    /*  343 */                   monster.cancelSingleStatus(s);
                                    /*      */                 }
                            /*      */             }
                        /*  350 */             if (isUseSkillEffect) {
                            /*  351 */               if (mskill != null)
                                /*  352 */                 effectSkill = mskill.getEffect(mskillevel);
                            /*  354 */               if (effectSkill != null &&
                                    /*  355 */                 attack.skillId != 0 && attack.skillId != 4100012 && attack.skillId != 4120019 && visProjectile > 0 &&
                                    /*  356 */                 effectSkill.makeChanceResult())
                                /*  357 */                 monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Poison, Integer.valueOf(effectSkill.getDOT()), mskillid, null, false, effectSkill.getDOTStack()), true, effectSkill.getDuration(), true, effectSkill);
                            /*      */             }
                        /*      */           }
                    /*  364 */           for (Triple<Integer, String, Integer> psdSkill : (Iterable<Triple<Integer, String, Integer>>)player.getStat().getPsdSkills()) {
                        /*  365 */             if (((Integer)psdSkill.left).intValue() == attack.skillId && attack.skillId != 0 && !((String)psdSkill.mid).isEmpty())
                            /*  366 */               totDamageToOneMonster = (long)(totDamageToOneMonster * (1.0D + MapleStatEffectFactory.parseEval((String)psdSkill.mid, player.getSkillLevel(((Integer)psdSkill.right).intValue())) / 100.0D));
                        /*      */           }
                    /*  375 */           boolean killmob = monster.damage(player, totDamageToOneMonster, true, attack.skillId);
                    /*  379 */           if (killmob) {
                        /*  380 */             killMobList.put(Integer.valueOf(monster.getObjectId()), Integer.valueOf(monster.getMobExpFromChannel()));
                        /*  381 */             lastKillMob = monster.getObjectId();
                        /*  382 */             lastKillMobExp = monster.getMobExpFromChannel();
                        /*  383 */             afterKillMonster(player, monster, attack.skillId);
                        /*      */           }
                    /*  387 */           boolean reflectDamage = true;
                    /*  388 */           if (attack.skillId == 36111004 || player.getBuffedValue(MapleBuffStat.至圣领域) != null || player.hasBuffSkill(61121053))
                        /*  389 */             reflectDamage = false;
                    /*  398 */           if (reflectDamage && monster.isBuffed(MonsterStatus.MOB_STAT_PCounter) && !theSkill.isIgnoreCounter() && !SkillConstants.isVSkill(attack.skillId))
                        /*  399 */             player.addHPMP(-5000, 0, false, true);
                    /*  401 */           onAttack(player, monster, attack.skillId, totalDamage, oned);
                    /*  405 */           if (totDamageToOneMonster > 0L) {
                        /*  407 */             Item weapon_ = player.getInventory(MapleInventoryType.EQUIPPED).getItem((short)-11);
                        /*  408 */             if (weapon_ != null) {
                            /*  409 */               MonsterStatus stat = GameConstants.getStatFromWeapon(weapon_.getItemId());
                            /*  410 */               if (stat != null && Randomizer.nextInt(100) < GameConstants.getStatChance()) {
                                /*  411 */                 MonsterStatusEffect monsterStatusEffect = new MonsterStatusEffect(stat, Integer.valueOf(GameConstants.getXForStat(stat)), GameConstants.getSkillForStat(stat), null, false, 0);
                                /*  412 */                 monster.applyStatus(player, monsterStatusEffect, false, 10000L, false, null);
                                /*      */               }
                            /*      */             }
                        /*  416 */             if (player.getBuffedValue(MapleBuffStat.炎术引燃) != null) {
                            /*  417 */               MapleStatEffect eff = player.getStatForBuff(MapleBuffStat.炎术引燃);
                            /*  418 */               if (eff != null && eff.makeChanceResult() && !monster.isBuffed(MonsterStatus.MOB_STAT_Poison))
                                /*  422 */                 monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Poison, Integer.valueOf(1), eff.getSourceid(), null, false), true, eff.getDOTTime(), true, eff);
                            /*  425 */             } else if (player.getBuffedValue(MapleBuffStat.额外回避) != null) {
                            /*  426 */               MapleStatEffect eff = player.getStatForBuff(MapleBuffStat.额外回避);
                            /*  427 */               if (eff != null && eff.makeChanceResult())
                                /*  428 */                 monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Speed, Integer.valueOf(eff.getX()), 3121007, null, false, 0), false, (eff.getY() * 1000), true, eff);
                            /*  430 */             } else if (player.getJob() == 121 || player.getJob() == 122) {
                            /*  431 */               Skill skill = SkillFactory.getSkill(1201012);
                            /*  432 */               if (player.isBuffFrom(MapleBuffStat.属性攻击, skill)) {
                                /*  433 */                 MapleStatEffect eff = skill.getEffect(player.getTotalSkillLevel(skill));
                                /*  434 */                 MonsterStatusEffect monsterStatusEffect = new MonsterStatusEffect(MonsterStatus.MOB_STAT_Freeze, Integer.valueOf(1), skill.getId(), null, false, 0);
                                /*  435 */                 monster.applyStatus(player, monsterStatusEffect, false, (eff.getY() * 2000), true, eff);
                                /*      */               }
                            /*  437 */             } else if (JobConstants.is战神(player.getJob())) {
                            /*  438 */               if (player.getBuffedValue(MapleBuffStat.属性攻击) != null && !monster.getStats().isBoss()) {
                                /*  439 */                 MapleStatEffect eff = player.getStatForBuff(MapleBuffStat.属性攻击);
                                /*  440 */                 if (eff != null)
                                    /*  441 */                   monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Speed, Integer.valueOf(eff.getX()), eff.getSourceid(), null, false, 0), false, (eff.getY() * 1000), true, eff);
                                /*      */               }
                            /*  444 */             } else if (JobConstants.is御剑骑士(player.getJob()) &&
                                /*  445 */               theSkill.getId() == 151121040) {
                            /*  446 */               Skill skill = SkillFactory.getSkill(151121040);
                            /*  447 */               MapleStatEffect eff = skill.getEffect(player.getTotalSkillLevel(skill));
                            /*  448 */               MonsterStatusEffect monsterStatusEffect = new MonsterStatusEffect(MonsterStatus.MOB_STAT_Freeze, Integer.valueOf(1), skill.getId(), null, false, 0);
                            /*  449 */               monster.applyStatus(player, monsterStatusEffect, false, eff.getDuration(), true, eff);
                            /*      */             }
                        /*      */           }
                    /*  454 */           if (effect != null && effect.getMonsterStati().size() > 0 &&
                            /*  455 */             effect.makeChanceResult())
                        /*  456 */             for (Map.Entry<MonsterStatus, Integer> z : (Iterable<Map.Entry<MonsterStatus, Integer>>)effect.getMonsterStati().entrySet())
                            /*  457 */               monster.applyStatus(player, new MonsterStatusEffect(z.getKey(), z.getValue(), theSkill.getId(), null, false, 0), effect.isPoison(), effect.getDuration(), true, effect);
                    /*      */         }
                /*  462 */         applyFinalAttack(attack, player);
                /*      */       }
            /*      */     }
        /*  466 */     if (monsterMaxHp > 0L && totDamageToOneMonster > 0L) {
            /*  467 */       afterAttack(player, monster, effect, attack.numAttacked, attack.numDamage, attack.skillId, isCritDamage);
            /*  468 */       if (!killMobList.isEmpty() && lastKillMob > 0)
                /*  469 */         handleKillMobs(player, killMobList.size(), lastKillMob, lastKillMobExp);
            /*      */     }
        /*  474 */     AttackEffect(player, effect, attack.numAttacked, attack.numDamage, attack.skillId);
        /*  478 */     if (!player.isIntern()) {
            /*  479 */       player.cancelEffectFromBuffStat(MapleBuffStat.风影漫步);
            /*  480 */       player.cancelEffectFromBuffStat(MapleBuffStat.潜入状态);
            /*  481 */       MapleStatEffect ds = player.getStatForBuff(MapleBuffStat.隐身术);
            /*  482 */       if (ds != null && (
                    /*  483 */         player.getJob() == 433 || player.getJob() == 434) &&
                    /*  484 */         ds.getSourceid() != 400001023)
                /*  485 */         Optional.<MapleStatEffect>ofNullable(SkillFactory.getSkill(4330001).getEffect(player.getTotalSkillLevel(4330001))).ifPresent(effect1 -> {
                    /*      */               if (!effect1.makeChanceResult())
                        /*      */                 player.cancelEffectFromBuffStat(MapleBuffStat.隐身术);
                    /*      */             });
            /*      */     }
        /*  508 */     if (effect != null && attack.skillId != 0 && !SkillConstants.isNoDelaySkill(attack.skillId) && !SkillConstants.isNoApplyTo(attack.skillId)) {
            /*  510 */       boolean isApplyTo = true;
            /*  512 */       if (effect.is超越攻击() && totDamageToOneMonster <= 0L)
                /*  513 */         isApplyTo = false;
            /*  517 */       if (theSkill.isKeydownSkill()) {
                /*  518 */         if (!player.getSpecialStat().isFirstUsekeydownSkill()) {
                    /*  520 */           player.getSpecialStat().setFirstUsekeydownSkill(true);
                    /*  522 */           effect.applyTo(player, attack.position, false);
                    /*      */         }
                /*  524 */         isApplyTo = false;
                /*      */       }
            /*  527 */       if (player.getSpecialStat().isSpecialAttack()) {
                /*  528 */         player.getSpecialStat().setSpecialAttack(false);
                /*  529 */         isApplyTo = false;
                /*      */       }
            /*  532 */       if (player.getSpecialStat().isMulitAttack()) {
                /*  533 */         player.getSpecialStat().setMulitAttack(false);
                /*  534 */         isApplyTo = false;
                /*      */       }
            /*  537 */       if (isApplyTo)
                /*  539 */         effect.applyTo(player, attack.position, false);
            /*      */     }
        /*  544 */     if (totalDamage > 1L && SkillConstants.getAttackDelay(attack.skillId, theSkill) >= 100) {
            /*  545 */       CheatTracker tracker = player.getCheatTracker();
            /*  546 */       tracker.setAttacksWithoutHit(true);
            /*  547 */       if (tracker.getAttacksWithoutHit() >= 50)
                /*  548 */         tracker.registerOffense(CheatingOffense.ATTACK_WITHOUT_GETTING_HIT, "无敌自动封号.");
            /*      */     }
        /*      */   }
    /*      */
    /*      */   public static void applyAttackMagic(AttackInfo attack, Skill theSkill, MapleCharacter player, MapleStatEffect effect, double maxDamagePerMonster) {
        /*  554 */     if (!player.isAlive()) {
            /*  555 */       player.getCheatTracker().registerOffense(CheatingOffense.ATTACKING_WHILE_DEAD);
            /*      */       return;
            /*      */     }
        /*  561 */     player.setLastAttackSkillId(attack.skillId);
        /*  562 */     int mobCount = effect.getMobCount(player);
        /*  563 */     int attackCount = effect.getAttackCount(player);
        /*  564 */     if (player.getStatForBuff(MapleBuffStat.光暗转换) != null)
            /*  565 */       attackCount *= 2;
        /*  567 */     if (player.getStatForBuff(MapleBuffStat.天使复仇) != null && attack.skillId == 2321007)
            /*  568 */       attackCount += 5;
        /*  570 */     if (attack.numDamage > attackCount || (attack.numAttacked > mobCount && attack.skillId != 27121303)) {
            /*  571 */       if (player.isShowPacket())
                /*  572 */         player.dropDebugMessage(3, "[攻击信息] 魔法攻击次数出错 解析攻击次数:" + attack.numDamage + " 实际次数:" + attackCount + " 解析怪物数量:" + attack.numAttacked + " 实际怪物数量:" + mobCount);
            /*  574 */       player.getCheatTracker().registerOffense(CheatingOffense.MISMATCHING_BULLETCOUNT, "异常的攻击次数.");
            /*  575 */       log.info("[作弊] " + player.getName() + " 魔法攻击次数异常  解析攻击次数:" + attack.numDamage + " 实际次数:" + attackCount + " 解析怪物数量:" + attack.numAttacked + " 实际怪物数量:" + mobCount);
            /*  576 */       if (ServerConstants.isShowGMMessage())
                /*  577 */         WorldBroadcastService.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(6, "[GM消息] " + player.getName() + " ID: " + player.getId() + " (等级 " + player.getLevel() + ") 魔法攻击次数异常。attack.hits " + attack.numDamage + " attackCount " + attackCount + " attack.targets " + attack.numAttacked + " MobCount " + mobCount + " 技能ID " + attack.skillId));
            /*      */       return;
            /*      */     }
        /*  581 */     if (attack.numDamage > 0 && attack.numAttacked > 0 &&
                /*  582 */       !player.getStat().checkEquipDurabilitys(player, -1)) {
            /*  583 */       player.dropMessage(5, "An item has run out of durability but has no inventory room to go to.");
            /*      */       return;
            /*      */     }
        /*  587 */     if (SkillConstants.isMulungSkill(attack.skillId)) {
            /*  588 */       if (player.getMapId() / 10000 != 92502)
                /*      */         return;
            /*  592 */       if (player.getMulungEnergy() < 10000)
                /*      */         return;
            /*  595 */       player.mulung_EnergyModify(false);
            /*  597 */     } else if (SkillConstants.isPyramidSkill(attack.skillId)) {
            /*  598 */       if (player.getMapId() / 1000000 != 926)
                /*      */         return;
            /*  602 */       if (player.getPyramidSubway() == null || !player.getPyramidSubway().onSkillUse(player))
                /*      */         return;
            /*  606 */     } else if (SkillConstants.isInflationSkill(attack.skillId) &&
                /*  607 */       player.getBuffedValue(MapleBuffStat.巨人药水) == null) {
            /*      */       return;
            /*      */     }
        /*  611 */     if (player.isAdmin())
            /*  612 */       player.dropMessage(-1, "攻击动作: " + Integer.toHexString(attack.display));
        /*  615 */     long maxDamagePerHit = player.getMaxDamageOver(attack.skillId);
        /*  617 */     long totDamage = 0L;
        /*  619 */     Skill eaterSkill = SkillFactory.getSkill(SkillConstants.getMPEaterForJob(player.getJob()));
        /*  620 */     int eaterLevel = player.getTotalSkillLevel(eaterSkill);
        /*  621 */     int lastKillMob = 0;
        /*  622 */     int lastKillMobExp = 0;
        /*  623 */     MapleMonster monster = null;
        /*  624 */     Map<Integer, Integer> killMobList = new LinkedHashMap<>();
        /*  626 */     MapleMap map = player.getMap();
        /*  628 */     if (attack.skillId != 2301002)
            /*  629 */       if (map.isPvpMap()) {
                /*  630 */         MaplePvp.doPvP(player, map, attack, effect);
                /*  631 */       } else if (map.isPartyPvpMap()) {
                /*  632 */         MaplePvp.doPartyPvP(player, map, attack, effect);
                /*  633 */       } else if (map.isGuildPvpMap()) {
                /*  634 */         MaplePvp.doGuildPvP(player, map, attack, effect);
                /*      */       }
        /*  638 */     for (AttackPair oned : attack.allDamage) {
            /*  639 */       monster = map.getMonsterByOid(oned.objectid);
            /*  640 */       if (monster != null && monster.getLinkCID() <= 0) {
                /*  641 */         long totDamageToOneMonster = 0L;
                /*  642 */         MapleMonsterStats monsterstats = monster.getStats();
                /*  643 */         long fixeddmg = monsterstats.getFixedDamage();
                /*  645 */         for (Pair<Long, Boolean> eachde : (Iterable<Pair<Long, Boolean>>)oned.attack) {
                    /*  646 */           long eachd = ((Long)eachde.left).longValue();
                    /*  647 */           if (fixeddmg != -1L) {
                        /*  648 */             eachd = monsterstats.getOnlyNoramlAttack() ? 0L : fixeddmg;
                        /*      */           } else {
                        /*  650 */             if (player.isShowPacket() && eachd > 0L)
                            /*  651 */               player.dropMessage(-1, "魔法攻击打怪伤害 : " + eachd + " 服务端预计伤害 : " + maxDamagePerHit + " 是否超过 : " + ((eachd > maxDamagePerHit) ? 1 : 0));
                        /*  653 */             if (monsterstats.getOnlyNoramlAttack()) {
                            /*  654 */               eachd = 0L;
                            /*  655 */             } else if (!player.isGM()) {
                            /*  656 */               if (eachd > maxDamagePerHit) {
                                /*  657 */                 player.getCheatTracker().registerOffense(CheatingOffense.HIGH_DAMAGE_MAGIC, "[伤害: " + eachd + ", 预期: " + maxDamagePerHit + ", 怪物ID: " + monster.getId() + "] [职业: " + player.getJob() + ", 等级: " + player.getLevel() + ", 技能: " + attack.skillId + "]");
                                /*  658 */                 if (attack.real)
                                    /*  659 */                   player.getCheatTracker().checkSameDamage(eachd, maxDamagePerHit);
                                /*  661 */                 if (eachd > maxDamagePerHit * 2L && attack.skillId != 27121303) {
                                    /*  662 */                   String banReason = player.getName() + " 被系统封号.[异常攻击伤害值: " + eachd + ", 预计伤害: " + maxDamagePerHit + ", 怪物ID: " + monster.getId() + "] [职业: " + player.getJob() + ", 等级: " + player.getLevel() + ", 技能: " + attack.skillId + "]";
                                    /*  663 */                   if (player.getLevel() < 10 && eachd >= 10000L) {
                                        /*  664 */                     AutobanManager.getInstance().autoban(player.getClient(), banReason);
                                        /*      */                     return;
                                        /*      */                   }
                                    /*  667 */                   if (player.getLevel() < 20 && eachd >= 20000L) {
                                        /*  668 */                     AutobanManager.getInstance().autoban(player.getClient(), banReason);
                                        /*      */                     return;
                                        /*      */                   }
                                    /*  671 */                   if (player.getLevel() < 30 && eachd >= 40000L) {
                                        /*  672 */                     AutobanManager.getInstance().autoban(player.getClient(), banReason);
                                        /*      */                     return;
                                        /*      */                   }
                                    /*  675 */                   if (player.getLevel() < 50 && eachd >= 60000L) {
                                        /*  676 */                     AutobanManager.getInstance().autoban(player.getClient(), banReason);
                                        /*      */                     return;
                                        /*      */                   }
                                    /*  679 */                   if (player.getLevel() < 70 && eachd >= 399999L) {
                                        /*  680 */                     AutobanManager.getInstance().autoban(player.getClient(), banReason);
                                        /*      */                     return;
                                        /*      */                   }
                                    /*  683 */                   if (player.getLevel() < 150 && eachd >= 599999L) {
                                        /*  684 */                     AutobanManager.getInstance().autoban(player.getClient(), banReason);
                                        /*      */                     return;
                                        /*      */                   }
                                    /*  687 */                   if (eachd > maxDamagePerHit * 3L) {
                                        /*  688 */                     AutobanManager.getInstance().autoban(player.getClient(), banReason);
                                        /*      */                     return;
                                        /*      */                   }
                                    /*  691 */                   player.getCheatTracker().registerOffense(CheatingOffense.HIGH_DAMAGE_MAGIC_2, "[伤害: " + eachd + ", 预期: " + maxDamagePerHit + ", 怪物ID: " + monster.getId() + "] [职业: " + player.getJob() + ", 等级: " + player.getLevel() + ", 技能: " + attack.skillId + "]");
                                    /*      */                 }
                                /*  694 */               } else if (eachd > maxDamagePerHit) {
                                /*  695 */                 eachd = (int)maxDamagePerHit;
                                /*      */               }
                            /*      */             }
                        /*      */           }
                    /*  700 */           totDamageToOneMonster += eachd;
                    /*      */         }
                /*  702 */         totDamage += totDamageToOneMonster;
                /*  703 */         player.checkMonsterAggro(monster);
                /*  704 */         if (SkillConstants.getAttackDelay(attack.skillId, theSkill) >= 50 && !SkillConstants.isNoDelaySkill(attack.skillId) && !SkillConstants.is不检测范围(attack.skillId) && !monster.getStats().isBoss() && player.getTruePosition().distanceSq(monster.getTruePosition()) > GameConstants.getAttackRange(effect, (player.getStat()).defRange) &&
                        /*  705 */           player.getMapId() != 703002000) {
                    /*  706 */           if (ServerConstants.isShowGMMessage())
                        /*  707 */             WorldBroadcastService.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(6, "[GM消息] " + player.getName() + " ID: " + player.getId() + " (等级 " + player.getLevel() + ") 攻击范围异常。职业: " + player.getJob() + " 技能: " + attack.skillId + " [范围: " + player.getTruePosition().distanceSq(monster.getTruePosition()) + " 预期: " + GameConstants.getAttackRange(effect, (player.getStat()).defRange) + "]"));
                    /*  709 */           player.getCheatTracker().registerOffense(CheatingOffense.ATTACK_FARAWAY_MONSTER, "[范围: " + player.getTruePosition().distanceSq(monster.getTruePosition()) + ", 预期范围: " + GameConstants.getAttackRange(effect, (player.getStat()).defRange) + " ] [职业: " + player.getJob() + " 技能: " + attack.skillId + " ]");
                    /*      */         }
                /*  712 */         if (attack.skillId == 2301002 && !monsterstats.getUndead()) {
                    /*  713 */           player.getCheatTracker().registerOffense(CheatingOffense.HEAL_ATTACKING_UNDEAD);
                    /*      */           return;
                    /*      */         }
                /*  716 */         if (totDamageToOneMonster > 0L) {
                    /*  717 */           boolean killmob = monster.damage(player, totDamageToOneMonster, true, attack.skillId);
                    /*  718 */           if (killmob) {
                        /*  719 */             killMobList.put(Integer.valueOf(monster.getObjectId()), Integer.valueOf(monster.getMobExpFromChannel()));
                        /*  720 */             lastKillMob = monster.getObjectId();
                        /*  721 */             lastKillMobExp = monster.getMobExpFromChannel();
                        /*  722 */             afterKillMonster(player, monster, attack.skillId);
                        /*      */           }
                    /*  724 */           if (monster.isBuffed(MonsterStatus.MOB_STAT_MCounter))
                        /*  725 */             player.addHP(-(7000 + Randomizer.nextInt(8000)));
                    /*  727 */           if (player.getBuffedValue(MapleBuffStat.缓速术) != null) {
                        /*  728 */             MapleStatEffect eff = player.getStatForBuff(MapleBuffStat.缓速术);
                        /*  729 */             if (eff != null && eff.makeChanceResult() && !monster.isBuffed(MonsterStatus.MOB_STAT_Speed))
                            /*  730 */               monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Speed, Integer.valueOf(eff.getX()), eff.getSourceid(), null, false, 0), false, (eff.getY() * 1000), true, eff);
                        /*      */           }
                    /*  733 */           if (player.getBuffedValue(MapleBuffStat.炎术引燃) != null) {
                        /*  734 */             MapleStatEffect eff = player.getStatForBuff(MapleBuffStat.炎术引燃);
                        /*  735 */             if (eff != null && eff.makeChanceResult() && !monster.isBuffed(MonsterStatus.MOB_STAT_Poison))
                            /*  736 */               monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Poison, Integer.valueOf(1), eff.getSourceid(), null, false, 0), true, eff.getDOTTime(), true, eff);
                        /*      */           }
                    /*  740 */           onAttack(player, monster, attack.skillId, totDamage, oned);
                    /*  743 */           if (effect != null && effect.getMonsterStati().size() > 0 &&
                            /*  744 */             effect.makeChanceResult())
                        /*  745 */             for (Map.Entry<MonsterStatus, Integer> z : (Iterable<Map.Entry<MonsterStatus, Integer>>)effect.getMonsterStati().entrySet())
                            /*  746 */               monster.applyStatus(player, new MonsterStatusEffect(z.getKey(), z.getValue(), theSkill.getId(), null, false, 0), effect.isPoison(), effect.getDuration(), true, effect);
                    /*  751 */           if (eaterLevel > 0)
                        /*  752 */             eaterSkill.getEffect(eaterLevel).applyPassive(player, (MapleMapObject)monster);
                    /*  755 */         } else if (attack.skillId == 27101101 && effect != null && effect.getMonsterStati().size() > 0 &&
                        /*  756 */           effect.makeChanceResult()) {
                    /*  757 */           for (Map.Entry<MonsterStatus, Integer> z : (Iterable<Map.Entry<MonsterStatus, Integer>>)effect.getMonsterStati().entrySet())
                        /*  758 */             monster.applyStatus(player, new MonsterStatusEffect(z.getKey(), z.getValue(), theSkill.getId(), null, false, 0), effect.isPoison(), effect.getDuration(), true, effect);
                    /*      */         }
                /*  764 */         applyFinalAttack(attack, player);
                /*      */       }
            /*      */     }
        /*  771 */     if (attack.skillId != 0 && !SkillConstants.isNoApplyTo(attack.skillId)) {
            /*  772 */       boolean isApplyTo = true;
            /*  774 */       if (theSkill.isKeydownSkill()) {
                /*  775 */         if (!player.getSpecialStat().isFirstUsekeydownSkill()) {
                    /*  777 */           player.getSpecialStat().setFirstUsekeydownSkill(true);
                    /*  779 */           effect.applyTo(player, attack.position, false);
                    /*      */         }
                /*  781 */         isApplyTo = false;
                /*      */       }
            /*  784 */       if (isApplyTo)
                /*  786 */         effect.applyTo(player, attack.position, false);
            /*      */     }
        /*  791 */     if (totDamage > 1L)
            /*  792 */       afterAttack(player, monster, effect, attack.numAttacked, attack.numDamage, attack.skillId, false);
        /*  794 */     if (!killMobList.isEmpty() && lastKillMob > 0)
            /*  795 */       handleKillMobs(player, killMobList.size(), lastKillMob, lastKillMobExp);
        /*  797 */     if (totDamage > 1L && SkillConstants.getAttackDelay(attack.skillId, theSkill) >= 100) {
            /*  798 */       CheatTracker tracker = player.getCheatTracker();
            /*  799 */       tracker.setAttacksWithoutHit(true);
            /*  800 */       if (tracker.getAttacksWithoutHit() >= 50)
                /*  801 */         tracker.registerOffense(CheatingOffense.ATTACK_WITHOUT_GETTING_HIT, "无敌自动封号.");
            /*      */     }
        /*  805 */     if (attack.skillId == 2321007 && player.getParty() != null)
            /*  806 */       for (MaplePartyCharacter pc : player.getParty().getMembers()) {
                /*  807 */         if (pc != null && pc.getMapid() == player.getMapId() && pc.getChannel() == player.getClient().getChannel()) {
                    /*  808 */           MapleCharacter other = player.getClient().getChannelServer().getPlayerStorage().getCharacterByName(pc.getName());
                    /*  809 */           if (other != null)
                        /*  810 */             other.addHP((int)((player.getStat().getCurrentMaxHp() * SkillFactory.getSkill(2321007).getEffect(player.getSkillLevel(2321007)).getX()) / 100.0D * 10.0D));
                    /*      */         }
                /*      */       }
        /*  815 */     if (attack.skillId == 2321052) {
            /*  816 */       MapleStatEffect tmpEffect = SkillFactory.getSkill(2321052).getEffect(player.getSkillLevel(2321052));
            /*  817 */       tmpEffect.applyTo(player);
            /*      */     }
        /*      */   }
    /*      */
    /*      */   private static void applyFinalAttack(AttackInfo attack, MapleCharacter player) {
        /*  823 */     if (attack.skillId > 0 && !SkillConstants.isMultiAttack(attack.skillId)) {
            /*  824 */       int skillId = attack.skillId;
            /*  825 */       int finalskillid = player.getStat().getFinalSkillID();
            /*      */       MapleStatEffect finalEffect;
            /*  827 */       if (finalskillid > 0 && finalskillid != skillId && (finalEffect = player.getSkillEffect(finalskillid)) != null) {
                /*  828 */         boolean isMake = finalEffect.makeChanceResult(player);
                /*  829 */         Item item = player.getInventory(MapleInventoryType.EQUIPPED).getItem((short)(JobConstants.is神之子(player.getJob()) ? -10 : -11));
                /*  830 */         MapleWeaponType weaponType = (item == null) ? MapleWeaponType.没有武器 : ItemConstants.getWeaponType(item.getItemId());
                /*  831 */         if (weaponType != MapleWeaponType.没有武器)
                    /*  832 */           player.getClient().announce(MaplePacketCreator.ExtraAttack(player.getCheatTracker().checkLastFinalAttack(), isMake ? 1 : 0, skillId, isMake ? finalskillid : 0, isMake ? weaponType.getWeaponType() : 0));
                /*      */       }
            /*      */     }
        /*      */   }
    /*      */
    /*      */   public static AttackInfo Modify_AttackCrit(AttackInfo attack, MapleCharacter chr, int type, MapleStatEffect effect) {
        if (attack.skillId == 侠盗.金钱炸弹) {
            return attack;
        }

        int criticalRate = chr.getStat().passive_sharpeye_rate() + (effect == null ? 0 : effect.getCritical());
        int critStorage = chr.getBuffedIntValue(MapleBuffStat.暴击蓄能);
        if (critStorage > 0) {
            criticalRate += critStorage;
            if (!attack.allDamage.isEmpty()) {
                chr.cancelEffectFromBuffStat(MapleBuffStat.暴击蓄能);
            }
        }
        boolean shadow = chr.getBuffedValue(MapleBuffStat.影分身) != null && (type == 1 || type == 2);
        List<Long> damages = new ArrayList<Long>(), damage = new ArrayList<Long>();
        int hit, toCrit, mid_att;
        for (AttackPair pair : attack.allDamage) {
            if (pair.attack != null) {
                hit = 0;
                mid_att = shadow ? (pair.attack.size() / 2) : pair.attack.size();
                toCrit = attack.skillId == 侠盗.暗杀_1 || attack.skillId == 箭神.一击要害箭 || attack.skillId == 双弩.闪电刀刃 || attack.skillId == 双刀.暗影飞跃斩 || attack.skillId == 双刀.地狱锁链 || attack.skillId == 战神.巨熊咆哮 ? mid_att : 0;
                if (toCrit == 0) {
                    for (Pair<Long, Boolean> eachd : pair.attack) {
                        if (!eachd.right && hit < mid_att) {
                            if (eachd.left > 999999 || Randomizer.nextInt(100) < criticalRate) {
                                toCrit++;
                            }
                            damage.add(eachd.left);
                        }
                        hit++;
                    }
                    if (toCrit == 0) {
                        damage.clear();
                        continue;
                    }
                    Collections.sort(damage);
                    for (int i = damage.size(); i > damage.size() - toCrit; i--) {
                        damages.add(damage.get(i - 1));
                    }
                    damage.clear();
                }
                hit = 0;
                for (Pair<Long, Boolean> eachd : pair.attack) {
                    if (!eachd.right) {
                        if (attack.skillId == 侠盗.暗杀) {
                            eachd.right = hit == 3;
                        } else if (attack.skillId == 箭神.一击要害箭 || attack.skillId == 双弩.闪电刀刃 || attack.skillId == 战神.巨熊咆哮 || attack.skillId == 双刀.暗影飞跃斩 || attack.skillId == 双刀.地狱锁链 || eachd.left > 999999) { //snipe always crit
                            eachd.right = true;
                        } else if (hit >= mid_att) {
                            eachd.right = pair.attack.get(hit - mid_att).right;
                        } else {
                            eachd.right = damages.contains(eachd.left);
                        }
                    }
                    hit++;
                }
                damages.clear();
            }
        }
        return attack;
        /*      */   }
    /*      */
    /*      */   public static AttackInfo 解析聚光灯(LittleEndianAccessor slea, MapleCharacter chr) {
        /*  907 */     AttackInfo attack = new AttackInfo();
        /*  908 */     attack.isCloseRangeAttack = true;
        /*  909 */     slea.readByte();
        /*  910 */     attack.numAttackedAndDamage = slea.readByte();
        /*  911 */     attack.numAttacked = (byte)(attack.numAttackedAndDamage >>> 4 & 0xF);
        /*  912 */     attack.numDamage = (byte)(attack.numAttackedAndDamage & 0xF);
        /*  913 */     slea.readInt();
        /*  914 */     attack.skillId = slea.readInt();
        /*  915 */     slea.readByte();
        /*  916 */     slea.readInt();
        /*  917 */     slea.readShort();
        /*  918 */     slea.readByte();
        /*  919 */     slea.readInt();
        /*  920 */     slea.readInt();
        /*  921 */     attack.charge = slea.readInt();
        /*  922 */     slea.readInt();
        /*  923 */     slea.readByte();
        /*  924 */     slea.readByte();
        /*  925 */     slea.readByte();
        /*  926 */     slea.readInt();
        /*  927 */     slea.readByte();
        /*  928 */     slea.readByte();
        /*  929 */     slea.readByte();
        /*  930 */     attack.display = slea.readByte();
        /*  931 */     attack.direction = slea.readByte();
        /*  932 */     slea.readInt();
        /*  933 */     slea.readByte();
        /*  934 */     attack.speed = slea.readByte();
        /*  935 */     attack.lastAttackTickCount = slea.readInt();
        /*  936 */     slea.skip(4);
        /*  937 */     attack.allDamage = new ArrayList<>();
        /*  938 */     for (byte b2 = 0; b2 < attack.numAttacked; b2 = (byte)(b2 + 1)) {
            /*  939 */       slea.skip(3);
            /*  940 */       int int1 = slea.readInt();
            /*  941 */       byte byte1 = slea.readByte();
            /*  942 */       byte byte2 = slea.readByte();
            /*  943 */       byte byte3 = slea.readByte();
            /*  944 */       slea.readByte();
            /*  945 */       slea.readByte();
            /*  946 */       slea.readInt();
            /*  947 */       slea.skip(1);
            /*  948 */       slea.skip(4);
            /*  949 */       slea.skip(4);
            /*  950 */       short short1 = slea.readShort();
            /*  951 */       slea.skip(4);
            /*  952 */       slea.skip(4);
            /*  953 */       List<Pair<Long, Boolean>> allDamageNumbers = new ArrayList<>();
            /*      */       byte b3;
            /*  954 */       for (b3 = 0; b3 < attack.numDamage; b3 = (byte)(b3 + 1)) {
                /*  955 */         long long1 = slea.readLong();
                /*  956 */         if (chr.isAdmin())
                    /*  957 */           chr.dropMessage(6, "[Spotlight Attack] Mob OID: " + String.valueOf(int1) + " Idx:" + (b3 + 1) + " - Damage: " + String.valueOf(long1));
                /*  960 */         allDamageNumbers.add(new Pair(Long.valueOf(long1), Boolean.valueOf(false)));
                /*      */       }
            /*  962 */       slea.skip(4);
            /*  963 */       slea.skip(4);
            /*  964 */       if (attack.skillId == 37111005)
                /*  965 */         slea.skip(1);
            /*  967 */       slea.skip(1);
            /*  968 */       slea.skip(1);
            /*  969 */       slea.skip(8);
            /*  970 */       slea.skip(1);
            /*  971 */       attack.allDamage.add(new AttackPair(int1, allDamageNumbers));
            /*      */     }
        /*  973 */     attack.position = slea.readPos();
        /*  975 */     return attack;
        /*      */   }
    /*      */
    /*      */   public static AttackInfo parseMagicDamage(LittleEndianAccessor lea, MapleCharacter chr) {
        /*  982 */     AttackInfo ai = new AttackInfo();
        /*  983 */     ai.isMagicAttack = true;
        /*  984 */     lea.skip(1);
        /*  985 */     ai.numAttackedAndDamage = lea.readByte();
        /*  986 */     ai.numAttacked = (byte)(ai.numAttackedAndDamage >>> 4 & 0xF);
        /*  987 */     ai.numDamage = (byte)(ai.numAttackedAndDamage & 0xF);
        /*  988 */     lea.readInt();
        /*  989 */     ai.skillId = lea.readInt();
        /*  990 */     ai.skllv = (byte)lea.readInt();
        /*  992 */     lea.skip(20);
        /*  993 */     lea.skip(8);
        /*  994 */     lea.readByte();
        /*  995 */     ai.charge = SkillConstants.isMagicChargeSkill(ai.skillId) ? lea.readInt() : -1;
        /*  996 */     lea.skip(1);
        /*  997 */     switch (ai.skillId) {
            /*      */       case 22140015:
                /*      */       case 22140024:
                /* 1000 */         lea.skip(4);
                /*      */         break;
            /*      */     }
        /* 1003 */     lea.readByte();
        /* 1004 */     ai.unk = lea.readByte();
        /* 1005 */     ai.display = lea.readByte();
        /* 1006 */     ai.direction = lea.readByte();
        /* 1007 */     lea.skip(4);
        /* 1008 */     lea.skip(1);
        /* 1009 */     switch (ai.skillId) {
            /*      */       case 12000026:
                /*      */       case 12100028:
                /*      */       case 12110028:
                /*      */       case 12120010:
                /*      */       case 22110022:
                /*      */       case 22110023:
                /*      */       case 22111011:
                /*      */       case 22111012:
                /*      */       case 22140022:
                /*      */       case 22141011:
                /*      */       case 22141012:
                /*      */       case 22170065:
                /*      */       case 22171062:
                /*      */       case 22171063:
                /*      */       case 400021012:
                /*      */       case 400021046:
                /* 1026 */         lea.skip(1);
                /*      */         break;
            /*      */     }
        /* 1029 */     ai.speed = lea.readByte();
        /* 1030 */     ai.lastAttackTickCount = lea.readInt();
        /* 1031 */     lea.skip(4);
        /* 1032 */     switch (ai.skillId) {
            /*      */       case 12000026:
                /*      */       case 12100028:
                /*      */       case 12110028:
                /*      */       case 12120010:
                /*      */       case 80001762:
                /* 1038 */         lea.skip(4);
                /*      */         break;
            /*      */     }
        /* 1042 */     lea.readByte();
        /* 1046 */     ai.allDamage = new ArrayList<>();
        /* 1047 */     boolean isOutput = false;
        /* 1048 */     long maxDamagePerHit = chr.getMaxDamageOver(ai.skillId);
        /* 1049 */     for (int i = 0; i < ai.numAttacked; i++) {
            /* 1050 */       int oid = lea.readInt();
            /* 1051 */       ai.ef = lea.readByte();
            /* 1052 */       byte by4 = lea.readByte();
            /* 1053 */       byte by5 = lea.readByte();
            /* 1054 */       short s2 = lea.readShort();
            /* 1055 */       lea.skip(4);
            /* 1056 */       lea.skip(1);
            /* 1057 */       lea.skip(4);
            /* 1058 */       lea.skip(4);
            /* 1059 */       if (ai.skillId == 42111002) {
                /* 1060 */         lea.skip(1);
                /* 1061 */         ai.numDamage = lea.readByte();
                /*      */       } else {
                /* 1063 */         if (lea.readByte() > 0)
                    /* 1064 */           lea.skip(1);
                /* 1066 */         lea.skip(1);
                /* 1067 */         lea.skip(4);
                /* 1068 */         lea.skip(4);
                /*      */       }
            /* 1070 */       List<Pair<Long, Boolean>> allDamageNumbers = new ArrayList<>();
            /* 1071 */       for (int j = 0; j < ai.numDamage; j++) {
                /* 1072 */         long damage = lea.readLong();
                /* 1073 */         if (chr.isShowPacket())
                    /* 1074 */           chr.dropMessage(-5, "魔法攻击 - 打怪数量: " + ai.numAttacked + " 打怪次数: " + ai.numDamage + " 怪物ID " + oid + " 伤害: " + damage);
                /* 1076 */         if (damage > maxDamagePerHit * 1.5D || damage < 0L || oid <= 0) {
                    /* 1077 */           if (chr.isAdmin())
                        /* 1078 */             chr.dropMessage(-5, "魔法攻击出错次数: 打怪数量: " + ai.numAttacked + " 打怪次数: " + ai.numDamage + " 怪物ID " + oid + " 伤害: " + damage + " 默认上限: " + maxDamagePerHit);
                    /* 1080 */           if (ServerConstants.isShowGMMessage())
                        /* 1081 */             WorldBroadcastService.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(6, "[GM消息] " + chr.getName() + " ID: " + chr.getId() + " (等级 " + chr.getLevel() + ") 魔法攻击伤害异常。打怪伤害: " + damage + " 地图ID: " + chr.getMapId()));
                    /* 1083 */           if (!isOutput) {
                        /* 1084 */             isOutput = true;
                        /* 1085 */             log.error("魔法攻击出错封包:  打怪数量: " + ai.numAttacked + " 打怪次数: " + ai.numDamage + " 怪物ID " + oid + " 伤害: " + damage + " 技能ID: " + ai.skillId + " 默认上限: " + maxDamagePerHit + lea.toString(true));
                        /*      */           }
                    /*      */         }
                /* 1088 */         allDamageNumbers.add(new Pair(Long.valueOf(damage), Boolean.valueOf(false)));
                /*      */       }
            /* 1090 */       int ksPsychicObjectId = -1;
            /* 1091 */       if (ai.skillId == 142110003 || ai.skillId == 142120001 || ai.skillId == 142120002) {
                /* 1092 */         ksPsychicObjectId = lea.readInt();
                /* 1093 */         lea.skip(4);
                /*      */       }
            /* 1095 */       if (ksPsychicObjectId >= 0) {
                /* 1096 */         ai.allDamage.add(new AttackPair(oid, ksPsychicObjectId, allDamageNumbers));
                /*      */       } else {
                /* 1098 */         ai.allDamage.add(new AttackPair(oid, allDamageNumbers));
                /*      */       }
            /* 1100 */       lea.skip(18);
            /* 1101 */       lea.readPos();
            /*      */     }
        /* 1103 */     ai.position = lea.readPos();
        /* 1104 */     return ai;
        /*      */   }
    /*      */
    /*      */   public static AttackInfo parseCloseRangeAttack(LittleEndianAccessor lea, MapleCharacter chr, boolean energy, boolean cluster, boolean spotlight) {
        /* 1116 */     AttackInfo ai = new AttackInfo();
        /* 1117 */     ai.isCloseRangeAttack = true;
        /* 1118 */     lea.skip(1);
        /* 1119 */     ai.numAttackedAndDamage = lea.readByte();
        /* 1120 */     ai.numAttacked = (byte)(ai.numAttackedAndDamage >>> 4 & 0xF);
        /* 1121 */     ai.numDamage = (byte)(ai.numAttackedAndDamage & 0xF);
        /* 1122 */     lea.skip(4);
        /* 1123 */     ai.skillId = lea.readInt();
        /* 1124 */     Skill skill = SkillFactory.getSkill(ai.skillId);
        /* 1125 */     ai.skllv = (byte)lea.readInt();
        /* 1132 */     switch (ai.skillId) {
            /*      */       case 2111007:
                /*      */       case 2201009:
                /*      */       case 2211007:
                /*      */       case 2311007:
                /*      */       case 4341052:
                /*      */       case 21001008:
                /*      */       case 31201001:
                /*      */       case 32111016:
                /*      */       case 131000016:
                /* 1142 */         lea.skip(4);
                /*      */         break;
            /*      */       default:
                /* 1145 */         if (SkillConstants.isInflationSkill(ai.skillId) || energy) {
                    /* 1146 */           lea.skip(4);
                    /*      */           break;
                    /*      */         }
                /* 1148 */         lea.skip(5);
                /*      */         break;
            /*      */     }
        /* 1152 */     lea.skip(4);
        /* 1153 */     lea.skip(1);
        /* 1154 */     lea.skip(4);
        /* 1155 */     ai.cashSlot = lea.readShort();
        /* 1156 */     lea.skip(4);
        /* 1157 */     switch (ai.skillId) {
            /*      */       case 1311011:
                /*      */       case 2221052:
                /*      */       case 4221052:
                /*      */       case 4341002:
                /*      */       case 5711021:
                /*      */       case 5721061:
                /*      */       case 11121052:
                /*      */       case 11121055:
                /*      */       case 12121054:
                /*      */       case 14121004:
                /*      */       case 21120018:
                /*      */       case 21120019:
                /*      */       case 21120023:
                /*      */       case 21120026:
                /*      */       case 21120027:
                /*      */       case 22171083:
                /*      */       case 24121000:
                /*      */       case 24121005:
                /*      */       case 25111005:
                /*      */       case 25121030:
                /*      */       case 27101202:
                /*      */       case 27111100:
                /*      */       case 27121201:
                /*      */       case 31001000:
                /*      */       case 31101000:
                /*      */       case 31111005:
                /*      */       case 31211001:
                /*      */       case 35121015:
                /*      */       case 36101001:
                /*      */       case 36121000:
                /*      */       case 41121001:
                /*      */       case 42120003:
                /*      */       case 65121003:
                /*      */       case 65121052:
                /*      */       case 101110101:
                /*      */       case 101110102:
                /*      */       case 101120200:
                /*      */       case 101120203:
                /*      */       case 101120205:
                /*      */       case 112001008:
                /*      */       case 112111016:
                /*      */       case 131001004:
                /*      */       case 131001008:
                /*      */       case 400001018:
                /* 1210 */         ai.charge = lea.readInt();
                /*      */         break;
            /*      */       default:
                /* 1213 */         ai.charge = (!energy && skill != null && skill.isChargeSkill() && ai.skillId != 4341052 && ai.skillId != 400041007 && ai.skillId != 400051006) ? lea.readInt() : 0;
                /*      */         break;
            /*      */     }
        /* 1216 */     if (SkillConstants.isSkip4CloseAttack(ai.skillId) || ai.skillId == 5300007 || ai.skillId == 27120211 || ai.skillId == 14111023 || ai.skillId == 400031010 || ai.skillId == 400031003 || ai.skillId == 400031004)
            /* 1217 */       lea.skip(4);
        /* 1220 */     if (JobConstants.is神之子(chr.getJob()) && ai.skillId >= 100000000)
            /* 1221 */       ai.zeroUnk = lea.readByte();
        /* 1223 */     if (SkillConstants.isSkip4Skill(ai.skillId) || ai.skillId == 400031010)
            /* 1224 */       lea.skip(4);
        /* 1226 */     lea.skip(6);
        /* 1227 */     lea.skip(1);
        /* 1233 */     lea.readByte();
        /* 1234 */     if (JobConstants.is魔链隐士(chr.getJob()) && ai.skillId != 64111012 && ai.skillId != 80001770)
            /* 1235 */       lea.skip(4);
        /* 1237 */     switch (ai.skillId) {
            /*      */       case 155001100:
                /*      */       case 155001102:
                /*      */       case 155001202:
                /*      */       case 155101013:
                /*      */       case 155101015:
                /*      */       case 155101100:
                /*      */       case 155101101:
                /*      */       case 155101104:
                /*      */       case 155101112:
                /*      */       case 155101114:
                /*      */       case 155101200:
                /*      */       case 155101201:
                /*      */       case 155101204:
                /*      */       case 155101212:
                /*      */       case 155101214:
                /*      */       case 155110000:
                /*      */       case 155110001:
                /*      */       case 155111002:
                /*      */       case 155111006:
                /*      */       case 155111102:
                /*      */       case 155111111:
                /*      */       case 155111202:
                /*      */       case 155111207:
                /*      */       case 155111211:
                /*      */       case 155111212:
                /*      */       case 155111306:
                /*      */       case 155120000:
                /*      */       case 155120001:
                /*      */       case 155121002:
                /*      */       case 155121007:
                /*      */       case 155121102:
                /*      */       case 155121202:
                /*      */       case 155121215:
                /*      */       case 155121306:
                /*      */       case 155121341:
                /*      */       case 400051334:
                /* 1274 */         lea.skip(10);
                /* 1275 */         if (lea.readInt() > 0) {
                    /* 1276 */           lea.readByte();
                    /* 1277 */           lea.readInt();
                    /* 1278 */           lea.readInt();
                    /* 1279 */           lea.readInt();
                    /*      */         }
                /*      */         break;
            /*      */       case 155121041:
                /* 1285 */         lea.readInt();
                /* 1286 */         lea.readShort();
                /* 1287 */         lea.readByte();
                /* 1288 */         lea.readInt();
                /* 1289 */         lea.readInt();
                /*      */         break;
            /*      */     }
        /* 1295 */     lea.skip(1);
        /* 1297 */     if (ai.skillId == 64121002 || ai.skillId == 400051334)
            /* 1298 */       lea.readInt();
        /* 1300 */     ai.unk = lea.readByte();
        /* 1301 */     ai.display = lea.readByte();
        /* 1302 */     ai.direction = lea.readByte();
        /* 1306 */     lea.skip(4);
        /* 1307 */     lea.skip(1);
        /* 1308 */     ai.speed = lea.readByte();
        /* 1309 */     ai.lastAttackTickCount = lea.readInt();
        /* 1310 */     if (ai.skillId == 33111013 || ai.skillId == 33121016)
            /* 1311 */       lea.skip(4);
        /* 1313 */     lea.skip(4);
        /* 1314 */     lea.skip(4);
        /* 1315 */     if (!energy && lea.readInt() > 0)
            /* 1316 */       lea.skip(1);
        /* 1318 */     if (ai.skillId == 5111009 || ai.skillId == 31201001)
            /* 1319 */       lea.skip(1);
        /* 1321 */     switch (ai.skillId) {
            /*      */       case 3311003:
                /*      */       case 3321014:
                /*      */       case 3321016:
                /*      */       case 3321018:
                /*      */       case 3321036:
                /*      */       case 3321040:
                /*      */       case 14121003:
                /*      */       case 21121068:
                /*      */       case 25111005:
                /*      */       case 400011080:
                /*      */       case 400011089:
                /*      */       case 400020002:
                /*      */       case 400021031:
                /*      */       case 400021041:
                /*      */       case 400021049:
                /*      */       case 400021050:
                /*      */       case 400031036:
                /*      */       case 400041021:
                /*      */       case 400041037:
                /*      */       case 400051043:
                /*      */       case 400051049:
                /*      */       case 400051050:
                /* 1344 */         lea.skip(4);
                /*      */         break;
            /*      */     }
        /* 1351 */     ai.allDamage = new ArrayList<>();
        /* 1355 */     long maxDamagePerHit = chr.getMaxDamageOver(ai.skillId);
        /* 1356 */     boolean isOutput = false;
        /* 1357 */     for (int i = 0; i < ai.numAttacked; i++) {
            /* 1358 */       if (ai.skillId == 400051018 || ai.skillId == 400051019 || ai.skillId == 400051020 || ai.skillId == 400051027)
                /* 1359 */         lea.skip(3);
            /* 1361 */       int oid = lea.readInt();
            /* 1362 */       ai.ef = lea.readByte();
            /* 1363 */       lea.skip(27);
            /* 1364 */       List<Pair<Long, Boolean>> allDamageNumbers = new ArrayList<>();
            /* 1365 */       for (int j = 0; j < ai.numDamage; j++) {
                /* 1366 */         long damage = lea.readLong();
                /* 1367 */         if (damage > maxDamagePerHit * 1.5D || damage < 0L || oid <= 0) {
                    /* 1368 */           if (chr.isShowPacket())
                        /* 1369 */             chr.dropDebugMessage(2, "[近距离攻击] 技能ID:" + ai.skillId + " 打怪数量: " + ai.numAttacked + " 打怪次数: " + ai.numDamage + " 怪物ID " + oid + " 伤害: " + damage + " 默认上限: " + maxDamagePerHit);
                    /* 1371 */           if (ServerConstants.isShowGMMessage())
                        /* 1372 */             WorldBroadcastService.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(6, "[GM消息] " + chr.getName() + " ID: " + chr.getId() + " (等级 " + chr.getLevel() + ") 近距离攻击伤害异常。打怪伤害: " + damage + " 地图ID: " + chr.getMapId()));
                    /* 1374 */           if (!isOutput)
                        /* 1375 */             isOutput = true;
                    /*      */         }
                /* 1379 */         allDamageNumbers.add(new Pair(Long.valueOf(damage), Boolean.valueOf(false)));
                /*      */       }
            /* 1382 */       lea.skip(18);
            /* 1383 */       lea.readPos();
            /* 1384 */       lea.skip(1);
            /* 1385 */       ai.allDamage.add(new AttackPair(oid, allDamageNumbers));
            /*      */     }
        /* 1387 */     if (lea.available() >= 4L)
            /* 1388 */       ai.position = lea.readPos();
        /* 1390 */     return ai;
        /*      */   }
    /*      */
    /*      */   public static AttackInfo parseRangedAttack(LittleEndianAccessor lea, MapleCharacter chr) {
        /* 1422 */     AttackInfo ai = new AttackInfo();
        /* 1423 */     ai.isRangedAttack = true;
        /* 1424 */     boolean b = (lea.readByte() == 1);
        /* 1425 */     lea.skip(1);
        /* 1426 */     ai.numAttackedAndDamage = lea.readByte();
        /* 1427 */     ai.numAttacked = (byte)(ai.numAttackedAndDamage >>> 4 & 0xF);
        /* 1428 */     ai.numDamage = (byte)(ai.numAttackedAndDamage & 0xF);
        /* 1429 */     lea.readInt();
        /* 1430 */     ai.skillId = lea.readInt();
        /* 1431 */     Skill skill = SkillFactory.getSkill(ai.skillId);
        /* 1432 */     ai.skllv = (byte)lea.readInt();
        /* 1434 */     lea.skip(6);
        /* 1435 */     lea.skip(4);
        /* 1437 */     lea.skip(4);
        /* 1438 */     ai.starSlot = lea.readShort();
        /* 1439 */     lea.skip(4);
        /* 1444 */     lea.skip(4);
        /* 1445 */     ai.charge = (skill != null && skill.isChargeSkill()) ? lea.readInt() : 0;
        /* 1447 */     if (JobConstants.is神之子(chr.getJob()) && ai.skillId >= 100000000)
            /* 1448 */       ai.zeroUnk = lea.readByte();
        /* 1450 */     if (b)
            /* 1451 */       lea.skip(4);
        /* 1453 */     if (SkillConstants.isSkip4Skill(ai.skillId))
            /* 1454 */       lea.skip(4);
        /* 1456 */     lea.readByte();
        /* 1457 */     lea.readInt();
        /* 1458 */     lea.readByte();
        /* 1459 */     lea.readByte();
        /* 1460 */     lea.readByte();
        /* 1461 */     if (lea.readByte() == 1)
            /* 1462 */       lea.readInt();
        /* 1464 */     lea.readByte();
        /* 1465 */     lea.readByte();
        /* 1466 */     ai.position = lea.readPos();
        /* 1467 */     ai.display = lea.readByte();
        /* 1468 */     ai.direction = lea.readByte();
        /* 1469 */     if (b)
            /* 1470 */       lea.skip(4);
        /* 1472 */     lea.skip(4);
        /* 1473 */     lea.skip(1);
        /* 1474 */     switch (ai.skillId) {
            /*      */       case 23111001:
                /*      */       case 36111010:
                /*      */       case 80001915:
                /* 1478 */         lea.skip(12);
                /*      */         break;
            /*      */     }
        /* 1484 */     ai.speed = lea.readByte();
        /* 1485 */     ai.lastAttackTickCount = lea.readInt();
        /* 1486 */     lea.skip(4);
        /* 1487 */     ai.AOE = (byte)lea.readShort();
        /* 1489 */     lea.readByte();
        /* 1490 */     lea.skip(8);
        /* 1491 */     lea.skip(4);
        /* 1493 */     if (ai.skillId == 23121052)
            /* 1494 */       lea.skip(4);
        /* 1500 */     ai.allDamage = new ArrayList<>();
        /* 1501 */     boolean isOutput = false;
        /* 1502 */     long maxDamagePerHit = chr.getMaxDamageOver(ai.skillId);
        /* 1503 */     for (int i = 0; i < ai.numAttacked; i++) {
            /* 1504 */       int oid = lea.readInt();
            /* 1505 */       ai.ef = lea.readByte();
            /* 1506 */       lea.skip(27);
            /* 1507 */       List<Pair<Long, Boolean>> allDamageNumbers = new ArrayList<>();
            /* 1508 */       for (int j = 0; j < ai.numDamage; j++) {
                /* 1509 */         long damage = lea.readLong();
                /* 1510 */         if (damage > maxDamagePerHit * 1.5D || damage < 0L || oid <= 0) {
                    /* 1511 */           if (chr.isShowPacket())
                        /* 1512 */             chr.dropDebugMessage(2, "[远距离攻击] 打怪数量: " + ai.numAttacked + " 打怪次数: " + ai.numDamage + " 怪物ID " + oid + " 伤害: " + damage + " 默认上限: " + maxDamagePerHit);
                    /* 1514 */           if (ServerConstants.isShowGMMessage())
                        /* 1515 */             WorldBroadcastService.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(6, "[GM消息] " + chr.getName() + " ID: " + chr.getId() + " (等级 " + chr.getLevel() + ") 远距离攻击伤害异常。打怪伤害: " + damage + " 地图ID: " + chr.getMapId()));
                    /* 1517 */           if (!isOutput)
                        /* 1518 */             isOutput = true;
                    /*      */         }
                /* 1524 */         allDamageNumbers.add(new Pair(Long.valueOf(damage), Boolean.valueOf(false)));
                /*      */       }
            /* 1526 */       lea.skip(18);
            /* 1527 */       lea.readPos();
            /* 1528 */       lea.skip(1);
            /* 1529 */       ai.allDamage.add(new AttackPair(oid, allDamageNumbers));
            /*      */     }
        /* 1531 */     ai.position = lea.readPos();
        /* 1532 */     if (lea.available() >= 4L)
            /* 1533 */       ai.skillposition = lea.readPos();
        /* 1535 */     return ai;
        /*      */   }
    /*      */
    /*      */   public static AttackInfo parseMesoExplosion(LittleEndianAccessor lea, AttackInfo ret, MapleCharacter chr) {
        /* 1544 */     if (ret.numDamage == 0) {
            /* 1545 */       lea.skip(4);
            /* 1546 */       byte b = lea.readByte();
            /* 1547 */       for (int k = 0; k < b; k++) {
                /* 1548 */         int mesoid = lea.readInt();
                /* 1549 */         lea.skip(2);
                /* 1550 */         if (chr.isShowPacket())
                    /* 1551 */           chr.dropDebugMessage(1, "[技能信息] 金钱炸弹攻击怪物: 无怪 " + ret.numDamage + " 金币ID: " + mesoid);
                /* 1553 */         lea.skip(1);
                /* 1554 */         ret.allDamage.add(new AttackPair(mesoid, null));
                /*      */       }
            /* 1556 */       lea.skip(2);
            /* 1557 */       return ret;
            /*      */     }
        /* 1561 */     for (int i = 0; i < ret.numAttacked; i++) {
            /* 1562 */       int oid = lea.readInt();
            /* 1563 */       lea.skip(19);
            /* 1564 */       byte b = lea.readByte();
            /* 1565 */       List<Pair<Long, Boolean>> allDamageNumbers = new ArrayList<>();
            /* 1566 */       for (int k = 0; k < b; k++) {
                /* 1567 */         long damage = lea.readInt();
                /* 1568 */         if (chr.isShowPacket())
                    /* 1569 */           chr.dropDebugMessage(1, "[技能信息] 金钱炸弹攻击怪物: " + ret.numAttacked + " 攻击次数: " + b + " 打怪伤害: " + damage);
                /* 1571 */         allDamageNumbers.add(new Pair(Long.valueOf(damage), Boolean.valueOf(false)));
                /*      */       }
            /* 1573 */       lea.skip(1);
            /* 1574 */       ret.allDamage.add(new AttackPair(oid, allDamageNumbers));
            /* 1575 */       lea.skip(8);
            /*      */     }
        /* 1577 */     lea.skip(4);
        /* 1578 */     byte bullets = lea.readByte();
        /* 1579 */     for (int j = 0; j < bullets; j++) {
            /* 1580 */       int mesoid = lea.readInt();
            /* 1581 */       lea.skip(2);
            /* 1582 */       if (chr.isShowPacket())
                /* 1583 */         chr.dropDebugMessage(1, "[技能信息] 金钱炸弹攻击怪物: 有怪 " + bullets + " 金币ID: " + mesoid);
            /* 1585 */       lea.skip(1);
            /* 1586 */       ret.allDamage.add(new AttackPair(mesoid, null));
            /*      */     }
        /* 1589 */     return ret;
        /*      */   }
    /*      */
    /*      */   public static AttackInfo parseWarLockMagicDamage(LittleEndianAccessor lea, MapleCharacter chr) {
        /* 1596 */     AttackInfo ret = new AttackInfo();
        /* 1597 */     ret.isMagicAttack = true;
        /* 1598 */     lea.skip(13);
        /* 1599 */     ret.numAttackedAndDamage = lea.readByte();
        /* 1600 */     ret.numAttacked = (byte)(ret.numAttackedAndDamage >>> 4 & 0xF);
        /* 1601 */     ret.numDamage = (byte)(ret.numAttackedAndDamage & 0xF);
        /* 1602 */     ret.skillId = lea.readInt();
        /* 1603 */     lea.skip(17);
        /* 1604 */     lea.skip(8);
        /* 1605 */     if (SkillConstants.isMagicChargeSkill(ret.skillId)) {
            /* 1606 */       ret.charge = lea.readInt();
            /*      */     } else {
            /* 1608 */       ret.charge = -1;
            /*      */     }
        /* 1610 */     lea.skip(7);
        /* 1611 */     lea.readByte();
        /* 1612 */     lea.readByte();
        /* 1613 */     ret.unk = lea.readByte();
        /* 1614 */     ret.display = lea.readByte();
        /* 1615 */     ret.direction = lea.readByte();
        /* 1616 */     lea.skip(4);
        /* 1617 */     lea.skip(1);
        /* 1621 */     ret.speed = lea.readByte();
        /* 1622 */     ret.lastAttackTickCount = lea.readInt();
        /* 1623 */     lea.skip(8);
        /* 1627 */     ret.allDamage = new ArrayList<>();
        /* 1628 */     for (int i = 0; i < ret.numAttacked; i++) {
            /* 1629 */       int oid = lea.readInt();
            /* 1630 */       lea.skip(28);
            /* 1631 */       List<Pair<Long, Boolean>> allDamageNumbers = new ArrayList<>();
            /* 1632 */       for (int j = 0; j < ret.numDamage; j++) {
                /* 1633 */         long damage = lea.readLong();
                /* 1634 */         allDamageNumbers.add(new Pair(Long.valueOf(damage), Boolean.valueOf(false)));
                /*      */       }
            /* 1636 */       lea.skip(10);
            /* 1637 */       lea.skip(1);
            /* 1638 */       ret.allDamage.add(new AttackPair(oid, allDamageNumbers));
            /*      */     }
        /* 1640 */     ret.position = lea.readPos();
        /* 1641 */     return ret;
        /*      */   }
    /*      */
    /*      */   public static boolean applyAttackCooldown(MapleStatEffect effect, MapleCharacter chr, int skillid, boolean isChargeSkill, boolean isBuff, boolean energy) {
        /* 1646 */     int cooldownTime = effect.getCooldown(chr);
        /* 1647 */     if (cooldownTime > 0) {
            /* 1648 */       if (chr.skillisCooling(skillid) && !isChargeSkill && !isBuff && !SkillConstants.isNoDelaySkill(skillid)) {
//                /* 1649 */         chr.dropMessage(5, "技能由于冷却时间限制，暂时无法使用。");
//                /* 1650 */         chr.send(MaplePacketCreator.enableActions());
//                /* 1651 */         return false;
                /* 1664 */         chr.addCooldown(skillid, System.currentTimeMillis(), (cooldownTime * 1000));
                /* 1665 */         chr.send(MaplePacketCreator.skillCooldown(SkillConstants.getLinkedAttackSkill(skillid), cooldownTime));
                /*      */       }
            /* 1653 */       if (chr.isAdmin() || energy) {
                /* 1654 */         if (isBuff) {
                    /* 1655 */           chr.dropDebugMessage(2, "[技能冷却] 为GM消除技能冷却时间, 原技能冷却时间:" + cooldownTime + "秒");
                    /* 1656 */           chr.send(MaplePacketCreator.skillCooldown(SkillConstants.getLinkedAttackSkill(skillid), 0));
                    /*      */         }
                /* 1659 */       } else if (ServerConfig.WORLD_SKILL_NOCOOLDOWN) {
                /* 1660 */         chr.dropDebugMessage(2, "[技能冷却] 为普通玩家消除BUFF技能冷却时间, 原技能冷却时间:" + cooldownTime + "秒.");
                /* 1661 */         chr.send(MaplePacketCreator.skillCooldown(SkillConstants.getLinkedAttackSkill(skillid), 0));
                /*      */       } else {
                /* 1664 */         chr.addCooldown(skillid, System.currentTimeMillis(), (cooldownTime * 1000));
                /* 1665 */         chr.send(MaplePacketCreator.skillCooldown(SkillConstants.getLinkedAttackSkill(skillid), cooldownTime));
                /*      */       }
            /*      */     }
        /* 1670 */     return true;
        /*      */   }
    /*      */
    /*      */   public static void onAttack(MapleCharacter player, MapleMonster monster, int skillid, long totDamage, AttackPair oned) {
        /* 1683 */     PlayerStats stats = player.getStat();
        /* 1684 */     PlayerSpecialStats specialStats = player.getSpecialStat();
        /* 1685 */     int job = player.getJob();
        /* 1686 */     int moboid = monster.getObjectId();
        /* 1687 */     long maxhp = monster.getMobMaxHp();
        /* 1688 */     Point point = monster.getPosition();
        /* 1690 */     player.setTotDamageToMob(totDamage);
        /* 1693 */     Integer value = player.getBuffedValue(MapleBuffStat.生命吸收);
        /* 1694 */     if (value != null && totDamage > 0L) {
            /*      */       int currentdate;
            /* 1697 */       MapleStatEffect effect = player.getStatForBuff(MapleBuffStat.生命吸收);
            /* 1698 */       double maxhp_per = 50.0D;
            /* 1699 */       switch (player.getBuffSource(MapleBuffStat.生命吸收)) {
                /*      */         case 31121002:
                    /* 1701 */           currentdate = Integer.valueOf(DateUtil.getCurrentDate("ddHHmmss")).intValue();
                    /* 1702 */           if (value.intValue() + effect.getY() > currentdate)
                        /*      */             break;
                    /* 1705 */           maxhp_per = effect.getW();
                    /* 1706 */           (player.getBuffStatValueHolder(MapleBuffStat.生命吸收)).value = currentdate;
                    /*      */         default:
                    /* 1709 */           player.addHP((int)Math.min(maxhp, Math.min((int)(totDamage * effect.getX() / 100.0D), stats.getMaxHp() / 100.0D * maxhp_per)));
                    /*      */           break;
                /*      */       }
            /*      */     }
        /* 1716 */     if (job == 321 || job == 322) {
            /* 1717 */       Optional.<Skill>ofNullable(SkillFactory.getSkill(3210013)).ifPresent(skill -> {
                /*      */             if (player.getTotalSkillLevel(skill) > 0) {
                    /*      */               MapleStatEffect effect = skill.getEffect(player.getTotalSkillLevel(skill));
                    /*      */               effect.applyTo(player, true);
                    /*      */             }
                /*      */           });
            /* 1723 */     } else if (job == 212 || job == 222 || job == 232) {
            /* 1724 */       int n4 = (player.getJob() == 212) ? 2120010 : ((player.getJob() == 222) ? 2220010 : 2320011);
            /* 1725 */       if (skillid == 2201009 || skillid == 2121054)
                /*      */         return;
            /* 1728 */       if (player.getTotalSkillLevel(SkillFactory.getSkill(n4)) > 0) {
                /* 1729 */         MapleStatEffect skillEffect = player.getSkillEffect(n4);
                /* 1730 */         if (skillEffect != null &&
                        /* 1731 */           skillEffect.makeChanceResult())
                    /* 1732 */           skillEffect.applyTo(player);
                /*      */       }
            /* 1749 */       if (skillid == 400021002)
                /* 1750 */         Optional.<Skill>ofNullable(SkillFactory.getSkill(400020002)).ifPresent(skill -> {
                    /*      */               MapleStatEffect effect = skill.getEffect(player.getTotalSkillLevel(skill));
                    /*      */               monster.getMap().spawnMist(new MapleMist(effect.calculateBoundingBox(monster.getTruePosition(), player.isFacingLeft()), player, effect, monster.getPosition()), effect.getDuration(), false);
                    /*      */             });
            /* 1755 */     } else if (job == 130 || job == 131 || job == 132) {
            /* 1756 */       if (totDamage > 0L && (
                    /* 1757 */         skillid == 400011068 || skillid == 400011069))
                /* 1758 */         Optional.<Skill>ofNullable(SkillFactory.getSkill(skillid)).ifPresent(skill -> {
                    /*      */               int skillLevel = player.getTotalSkillLevel(skill);
                    /*      */               if (skillLevel > 0) {
                        /*      */                 MapleStatEffect effect = skill.getEffect(skillLevel);
                        /*      */                 if (effect != null) {
                            /*      */                   int hpheal = (int)(stats.getCurrentMaxHp() * effect.getW() / 100.0D);
                            /*      */                   player.addHP(hpheal);
                            /*      */                 }
                        /*      */               }
                    /*      */             });
            /* 1770 */     } else if (player.getBuffSource(MapleBuffStat.守护模式变更) == 110001501) {
            /* 1771 */       Optional.<Skill>ofNullable(SkillFactory.getSkill(112100011)).ifPresent(skill -> {
                /*      */             if (player.getTotalSkillLevel(skill) > 0) {
                    /*      */               MapleStatEffect effect = skill.getEffect(player.getTotalSkillLevel(skill));
                    /*      */               if (effect != null && effect.makeChanceResult() && totDamage > 0L)
                        /*      */                 player.addHP((int)Math.min(maxhp, Math.min((int)(totDamage * effect.getX() / 100.0D), stats.getMaxHp() / 10)));
                    /*      */             }
                /*      */           });
            /* 1781 */     } else if (JobConstants.is侠盗(job)) {
            /* 1782 */       int s = (player.getTotalSkillLevel(4220015) > 0) ? 4220015 : 4200013;
            /* 1783 */       Optional.<Skill>ofNullable(SkillFactory.getSkill(s)).ifPresent(skill -> {
                /*      */             MapleStatEffect eff = skill.getEffect(player.getTotalSkillLevel(skill));
                /*      */             if (player.getTotalSkillLevel(skill) > 0) {
                    /*      */               int critical = Math.min(100, eff.getX() + player.getCriticalGrowth());
                    /* 1787 */               player.setCriticalGrowth((critical > 0 && critical <= 100) ? critical : 0);
                    /*      */               eff.applyTo(player);
                    /*      */             }
                /*      */           });
            /* 1793 */       if (player.getBuffedValue(MapleBuffStat.敛财术) != null) {
                /*      */         int maxmeso;
                /* 1795 */         switch (skillid) {
                    /*      */           case 0:
                        /*      */           case 4001334:
                        /*      */           case 4201012:
                        /*      */           case 4211002:
                        /*      */           case 4211011:
                        /*      */           case 4221007:
                        /*      */           case 4221010:
                        /* 1803 */             maxmeso = player.getBuffedValue(MapleBuffStat.敛财术).intValue();
                        /* 1804 */             Optional.<Skill>ofNullable(SkillFactory.getSkill(4211003)).ifPresent(skill1 -> {
                            /*      */                   MapleStatEffect effect = skill1.getEffect(player.getTotalSkillLevel(4211003));
                            /*      */                   for (Pair<Long, Boolean> eachde : (Iterable<Pair<Long, Boolean>>)oned.attack) {
                                /*      */                     long num = ((Long)eachde.left).longValue();
                                /*      */                     if ((player.getStat()).pickRate >= 100 || Randomizer.nextInt(99) < (player.getStat()).pickRate) {
                                    /*      */                       player.getMap().spawnMesoDrop(Math.min((int)Math.max(num / 20000.0D * maxmeso, 1.0D), maxmeso), new Point((int)(monster.getTruePosition().getX() + Randomizer.nextInt(100) - 50.0D), (int)monster.getTruePosition().getY()), (MapleMapObject)monster, player, false, (byte)0);
                                    /*      */                       player.setBuffedValue(MapleBuffStat.敛财术, Math.min(effect.getY(), player.getBuffedIntValue(MapleBuffStat.敛财术) + 1));
                                    /*      */                       effect.applyTo(player, true);
                                    /*      */                     }
                                /*      */                   }
                            /*      */                 });
                        /*      */             break;
                    /*      */         }
                /*      */       }
            /* 1819 */       player.handleKillSpreeGain();
            /* 1821 */     } else if (JobConstants.is恶魔猎手(job)) {
            /* 1822 */       player.handleForceGain(moboid, skillid);
            /* 1823 */       player.handle暴虐双生神();
            /*      */       MapleStatEffect attackeffect;
            /* 1825 */       if ((attackeffect = player.getSkillEffect(400011006)) != null) {
                /* 1826 */         MapleSummon summon = player.getSummonBySkill(attackeffect.getSourceid());
                /* 1827 */         if (summon != null)
                    /* 1829 */           if (summon.checkLastAttackTime())
                        /* 1830 */             player.getMap().broadcastMessage(SummonPacket.summonSkillLink(player.getId(), summon.getObjectId(), 0), player.getTruePosition());
                /*      */       }
            /* 1834 */     } else if (JobConstants.is古迹猎人(player.getJob())) {
            /* 1835 */       player.handle削弱诅咒();
            /* 1836 */       player.handle精神之箭(skillid, monster);
            /* 1837 */       if (skillid == 3011004 || skillid == 3300002 || skillid == 3321003)
                /* 1838 */         player.addForceCon((player.getJob() == 332) ? 10 : 5, true);
            /* 1840 */     } else if (JobConstants.is夜行者(job)) {
            /* 1842 */       if (player.getBuffedValue(MapleBuffStat.影子蝙蝠) != null && (
                    /* 1843 */         skillid == 14001020 || skillid == 14101020 || skillid == 14111020 || skillid == 14121001)) {
                /* 1844 */         player.handle影子蝙蝠(moboid);
                /* 1846 */         player.handle影子分裂(moboid, point);
                /*      */       }
            /* 1849 */       if (player.getBuffedValue(MapleBuffStat.SECONDARY_STAT_SpinesOfShadow) != null && (
                    /* 1850 */         skillid != 400040008 || skillid != 14121003))
                /* 1851 */         player.handle影之地刺(point);
            /* 1855 */     } else if (JobConstants.is幻影(job)) {
            /* 1856 */       if (skillid != 24120002 && skillid != 24100003)
                /* 1857 */         player.handleCarteGain(moboid, false);
            /* 1859 */       if (skillid == 400041023)
                /* 1860 */         player.handle黑杰克反射(monster, moboid);
            /* 1862 */     } else if (JobConstants.is隐月(job)) {
            /* 1863 */       Optional.<Skill>ofNullable(SkillFactory.getSkill(20050285)).ifPresent(skill -> {
                /*      */             if (player.getTotalSkillLevel(skill) > 0) {
                    /*      */               MapleStatEffect effect = skill.getEffect(player.getTotalSkillLevel(skill));
                    /*      */               if (totDamage > 0L)
                        /*      */                 player.addHP((int)Math.min(maxhp, Math.min((int)(totDamage * effect.getX() / 100.0D), stats.getMaxHp() / 2)));
                    /*      */             }
                /*      */           });
            /* 1871 */     } else if (JobConstants.is尖兵(job)) {
            /* 1872 */       player.addPowerCount(1);
            /* 1873 */       if (monster.isAlive() && monster.getTriangulation() >= 3 && monster.isBuffed(MonsterStatus.MOB_STAT_Explosion)) {
                /* 1874 */         monster.setTriangulation(0);
                /* 1875 */         monster.cancelStatus(MonsterStatus.MOB_STAT_Explosion);
                /* 1876 */         monster.cancelStatus(MonsterStatus.MOB_STAT_EVA);
                /* 1877 */         monster.cancelStatus(MonsterStatus.MOB_STAT_Blind);
                /* 1878 */         player.send(ForcePacket.UserExplosionAttack(monster));
                /*      */         return;
                /*      */       }
            /* 1881 */       if (player.getSkillLevel(36110005) > 0 && monster.isAlive())
                /* 1882 */         Optional.<Skill>ofNullable(SkillFactory.getSkill(36110005)).ifPresent(skill -> {
                    /*      */               MapleStatEffect effect = skill.getEffect(player.getSkillLevel(skill));
                    /*      */               if (player.getLastComboTime() + (effect.getY() * 1000) < System.currentTimeMillis())
                        /*      */                 monster.setTriangulation(0);
                    /*      */               if (effect.makeChanceResult()) {
                        /*      */                 player.setLastComboTime(System.currentTimeMillis());
                        /*      */                 if (monster.getTriangulation() < 3) {
                            /*      */                   monster.setTriangulation(monster.getTriangulation() + 1);
                            /*      */                   List<MonsterStatusEffect> arrayList = new ArrayList<>();
                            /*      */                   arrayList.add(new MonsterStatusEffect(MonsterStatus.MOB_STAT_EVA, Integer.valueOf(-monster.getTriangulation() * effect.getX()), effect.getSourceid(), null, false));
                            /*      */                   arrayList.add(new MonsterStatusEffect(MonsterStatus.MOB_STAT_Blind, Integer.valueOf(monster.getTriangulation() * effect.getX()), effect.getSourceid(), null, false));
                            /*      */                   arrayList.add(new MonsterStatusEffect(MonsterStatus.MOB_STAT_Explosion, Integer.valueOf(monster.getTriangulation()), effect.getSourceid(), null, false));
                            /*      */                   monster.applyStatus(player, arrayList, false, (effect.getY() * 1000), true, effect);
                            /*      */                 }
                        /*      */               }
                    /*      */             });
            /* 1900 */     } else if (JobConstants.is恶魔复仇者(job)) {
            /* 1901 */       if (totDamage > 0L)
                /* 1902 */         Optional.<Skill>ofNullable(SkillFactory.getSkill(31010002)).ifPresent(skill -> {
                    /*      */               int skillLevel = player.getTotalSkillLevel(skill);
                    /*      */               if (skillLevel > 0) {
                        /*      */                 MapleStatEffect effect = skill.getEffect(skillLevel);
                        /*      */                 if (effect != null && effect.makeChanceResult()) {
                            /*      */                   int hpheal = (int)(stats.getCurrentMaxHp() * effect.getX() / 100.0D);
                            /*      */                   if (player.isShowPacket())
                                /*      */                     player.dropDebugMessage(1, "[恶魔复仇者] 攻击恢复Hp " + hpheal);
                            /*      */                   player.addHP(hpheal);
                            /*      */                 }
                        /*      */               }
                    /*      */             });
            /* 1916 */     } else if (JobConstants.is唤灵斗师(job)) {
            /* 1917 */       player.handleDeathPact(moboid, true);
            /* 1918 */     } else if (JobConstants.is神射手(job)) {
            /* 1919 */       if (skillid != 95001000) {
                /* 1921 */         if (player.getBuffedValue(MapleBuffStat.三彩箭矢) != null && specialStats.getArrowsMode() == 0 && Randomizer.nextInt(100) <= 50 &&
                        /* 1922 */           totDamage > 0L)
                    /* 1923 */           player.addHP((int)Math.min(maxhp, Math.min((int)(totDamage * 20.0D / 100.0D), stats.getMaxHp() / 2)));
                /* 1926 */         player.handleArrowsCharge(moboid);
                /*      */       }
            /* 1930 */       player.handle全箭发射(player, monster);
            /* 1932 */     } else if (JobConstants.is超能力者(player.getJob())) {
            /* 1933 */       if (SkillConstants.isKSTelekinesisSkill(skillid))
                /* 1934 */         player.handlerKSTelekinesis(moboid);
            /* 1936 */     } else if (JobConstants.is奇袭者(player.getJob())) {
            /* 1937 */       player.handle元素雷电(skillid);
            /* 1939 */     } else if (JobConstants.is圣骑士(player.getJob())) {
            /* 1941 */       MapleCharacter.handleElementalCharge(player, skillid);
            /* 1942 */     } else if (skillid == 65111007) {
            /* 1943 */       player.handle灵魂吸取(monster.getObjectId());
            /* 1944 */     } else if (player.getJob() == 6412) {
            /* 1945 */       if (player.getBuffedValue(MapleBuffStat.锁链术_狂怒) != null)
                /* 1946 */         player.handle锁链术狂怒(monster);
            /* 1948 */     } else if (job == 310 || job == 311 || job == 312) {
            /* 1949 */       int[] skillIds = { 3110001, 3110012 };
            /* 1950 */       for (int i : skillIds) {
                /* 1951 */         Skill skill = SkillFactory.getSkill(i);
                /* 1952 */         if (player.getTotalSkillLevel(skill) > 0) {
                    /* 1953 */           MapleStatEffect effect = skill.getEffect(player.getTotalSkillLevel(skill));
                    /* 1954 */           effect.applyTo(player, true);
                    /*      */         }
                /*      */       }
            /* 1976 */     } else if (job == 15500 || job == 15510 || job == 15511 || job == 15512) {
            /* 1978 */       if ((skillid == 155001202 || skillid == 155110001 || skillid == 155101200 || skillid == 155101201 || skillid == 155111212 || skillid == 155120001 || skillid == 155121202) &&
                    /* 1979 */         totDamage > 0L) {
                /* 1980 */         MapleStatEffect effect = SkillFactory.getSkill(skillid).getEffect(player.getTotalSkillLevel(skillid));
                /* 1981 */         int hpheal = (int)(stats.getCurrentMaxHp() * effect.getW() / 100.0D);
                /* 1982 */         if (player.isShowPacket())
                    /* 1983 */           player.dropDebugMessage(1, "[" + SkillFactory.getSkillName(skillid) + "] 攻击恢复" + effect.getW() + "%Hp:" + hpheal);
                /* 1985 */         player.healHP(hpheal);
                /*      */       }
            /* 1989 */       if (skillid == 155121306) {
                /* 1991 */         if (player.getBuffedValue(MapleBuffStat.幽灵侵蚀) == null)
                    /* 1992 */           SkillFactory.getSkill(155000007).getEffect(player.getSkillLevel(155000007)).applyTo(player, true);
                /* 1995 */         Optional.<Skill>ofNullable(SkillFactory.getSkill(155121006)).ifPresent(skill -> {
                    /*      */               int totalSkillLevel = player.getTotalSkillLevel(155121006);
                    /*      */               MapleStatEffect effect = skill.getEffect(totalSkillLevel);
                    /*      */               if (totalSkillLevel > 0 && effect != null) {
                        /*      */                 Rectangle bounds = effect.calculateBoundingBox(monster.getTruePosition(), player.isFacingLeft());
                        /*      */                 MapleMist mist = new MapleMist(bounds, player, effect, monster.getPosition());
                        /*      */                 monster.getMap().spawnMist(mist, effect.getDuration(), false);
                        /*      */               }
                    /*      */             });
                /*      */       }
            /* 2005 */     } else if (JobConstants.is虎影(player.getJob())) {
            /* 2007 */       handle封魔葫芦符(player, monster, skillid);
            /* 2008 */       handle幻影分身符(player, skillid);
            /* 2009 */       handle地震碎_地(player, monster, skillid);
            /* 2010 */       handle卷术微生强变(player, monster, skillid);
            /* 2011 */       handle卷术蝶梦(player, skillid);
            /* 2012 */     } else if (JobConstants.is御剑骑士(player.getJob()) && (
                /* 2013 */       skillid == 151101000 || skillid == 151111000 || skillid == 151121000 || skillid == 151121002)) {
            /* 2014 */       MapleStatEffect skillEffect = player.getSkillEffect(151100017);
            /* 2015 */       player.gainCKZZ(skillEffect.getS());
            /* 2016 */       if (player.getBuffedValue(MapleBuffStat.出神) != null &&
                    /* 2017 */         System.currentTimeMillis() >= player.getLastUseSkillTimeExt(151001001)) {
                /* 2018 */         List<MapleBlueSkySword> Sword = new ArrayList<>();
                /* 2019 */         int[] width = { 0, 120, 120, 240, 240 };
                /* 2020 */         int[] angle = { 0, -15, 15, -30, 30 };
                /* 2021 */         Point pos = player.getPosition();
                /* 2022 */         Point[] poss = { new Point(pos.x, pos.y - 120), new Point(pos.x - 40, pos.y - 100), new Point(pos.x + 40, pos.y - 100), new Point(pos.x - 80, pos.y - 80), new Point(pos.x + 80, pos.y - 80) };
                /* 2023 */         for (int i = 0; i < 5; i++)
                    /* 2024 */           Sword.add(new MapleBlueSkySword(player, 1 + i, 0, 0, width[i], 600, angle[i], 151001001, 2400, 1, poss[i]));
                /* 2026 */         player.getMap().broadcastMessage(MapleBlueSkySwordPacket.SpawnBlueSkySword(player.getId(), Sword, 0));
                /* 2028 */         player.setLastUseSkillTimeExt(151001001, System.currentTimeMillis() + 8000L);
                /*      */       }
            /* 2031 */       if (player.hasBuffSkill(151101006) &&
                    /* 2032 */         System.currentTimeMillis() >= player.getLastUseSkillTimeExt(151101006)) {
                /* 2033 */         int group = specialStats.isDZ3() ? 3 : (specialStats.isDZ2() ? 2 : (specialStats.isDZ1() ? 1 : 0));
                /* 2034 */         if (group > 0) {
                    /* 2035 */           player.getMap().broadcastMessage(MapleBlueSkySwordPacket.PassiveBlueSkySwordSkillEffect(player, 1, group));
                    /* 2037 */           if (specialStats.isDZ1())
                        /* 2038 */             player.getMap().broadcastMessage(MapleBlueSkySwordPacket.PassiveBlueSkySwordSkillEffect(player, 2, 0));
                    /* 2040 */           if (specialStats.isDZ2()) {
                        /* 2041 */             player.getMap().broadcastMessage(MapleBlueSkySwordPacket.PassiveBlueSkySwordSkillEffect(player, 3, 0));
                        /* 2042 */             player.getMap().broadcastMessage(MapleBlueSkySwordPacket.PassiveBlueSkySwordSkillEffect(player, 4, 0));
                        /*      */           }
                    /* 2044 */           if (specialStats.isDZ3()) {
                        /* 2045 */             player.getMap().broadcastMessage(MapleBlueSkySwordPacket.PassiveBlueSkySwordSkillEffect(player, 5, 0));
                        /* 2046 */             player.getMap().broadcastMessage(MapleBlueSkySwordPacket.PassiveBlueSkySwordSkillEffect(player, 6, 0));
                        /*      */           }
                    /* 2050 */           player.setLastUseSkillTimeExt(151101006, System.currentTimeMillis() + ((player.getJob() == 15111 || player.getJob() == 15112) ? 9000L : 12000L));
                    /*      */         }
                /*      */       }
            /*      */     }
        /* 2057 */     if (skillid > 0)
            /* 2058 */       Optional.<Skill>ofNullable(SkillFactory.getSkill(skillid)).ifPresent(skil -> {
                /*      */             int[] skills;
                /*      */             int[] skillss;
                /*      */             int skillS;
                /*      */             MapleStatEffect effect = skil.getEffect(player.getTotalSkillLevel(skil));
                /*      */             switch (skillid) {
                    /*      */               case 1078:
                        /*      */               case 31111003:
                        /*      */               case 33001016:
                        /*      */                 if (totDamage > 0L)
                            /*      */                   player.addHP((int)Math.min(maxhp, Math.min((int)(totDamage * effect.getX() / 100.0D), stats.getMaxHp() / 2)));
                        /*      */                 break;
                    /*      */               case 5221015:
                        /*      */                 player.setLinkMid(moboid, effect.getX());
                        /*      */                 break;
                    /*      */               case 4001334:
                        /*      */               case 4001344:
                        /*      */               case 4101008:
                        /*      */               case 4101010:
                        /*      */               case 4111010:
                        /*      */               case 4111015:
                        /*      */               case 4121013:
                        /*      */               case 4201012:
                        /*      */               case 4211002:
                        /*      */               case 4211011:
                        /*      */               case 4221007:
                        /*      */               case 4221010:
                        /*      */               case 4221014:
                        /*      */               case 4311002:
                        /*      */               case 4311003:
                        /*      */               case 4321004:
                        /*      */               case 4321006:
                        /*      */               case 4331000:
                        /*      */               case 4331006:
                        /*      */               case 4341002:
                        /*      */               case 4341004:
                        /*      */               case 4341009:
                        /*      */               case 14110004:
                        /*      */               case 14111002:
                        /*      */               case 14111005:
                        skills = new int[] { 4210010, 4110011, 4320005 };
                        skillss = new int[] { 4220011, 4120011, 4340012 };
                        skillS = 0;
                        for (int i : skillss) {
                            if (player.getTotalSkillLevel(i) > 0) {
                                skillS = i;
                                break;
                            }
                        }
                        for (int i : skills) {
                            int finalSkillS = skillS;
                            Skill skill = SkillFactory.getSkill(i);
                            if (player.getTotalSkillLevel(skill) > 0) {
                                MapleStatEffect venomEffect = skill.getEffect(player.getTotalSkillLevel(skill));
                                if (player.getTotalSkillLevel(finalSkillS) > 0) {
                                    Optional.ofNullable(SkillFactory.getSkill(skillS)).ifPresent((skill1) -> {
                                        MapleStatEffect effect1 = skill1.getEffect(player.getTotalSkillLevel(skill1));
                                        int szie = 0;
                                        Iterator var6 = monster.getAllBuffs().iterator();

                                        while(var6.hasNext()) {
                                            MonsterStatusEffect s = (MonsterStatusEffect)var6.next();
                                            if (s.getSkill() == finalSkillS) {
                                                ++szie;
                                            }
                                        }

                                        if (effect1.makeChanceResult() && szie < effect1.getDOTStack() + 1) {
                                            monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Poison, effect1.getDOT(), finalSkillS, (MobSkill)null, false), true, (long)effect1.getDuration(), true, effect1);
                                        }

                                    });

                                }
                                if (venomEffect.makeChanceResult())
                                    monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Poison, Integer.valueOf(1), i, null, false), true, venomEffect.getDuration(), true, venomEffect);
                                break;
                            }
                        }
                        break;
                    /*      */               case 4201004:
                        /*      */                 monster.handleSteal(player);
                        /*      */                 break;
                    /*      */               case 14001020:
                        /*      */               case 14101020:
                        /*      */               case 14101021:
                        /*      */               case 14111020:
                        /*      */               case 14111021:
                        /*      */               case 14121001:
                        /*      */               case 14121002:
                        /*      */                 if (player.getBuffedValue(MapleBuffStat.元素黑暗) != null);
                        /*      */                 break;
                    /*      */               case 2211010:
                        /*      */                 monster.setTempEffectiveness(Element.冰, effect.getDuration());
                        /*      */                 break;
                    /*      */               case 2121003:
                        /*      */                 monster.setTempEffectiveness(Element.火, effect.getDuration());
                        /*      */                 break;
                    /*      */               case 400031020:
                        /*      */                 player.handle残影之矢();
                        /*      */                 break;
                    /*      */             }
                /*      */           });
        /*      */   }
    /*      */
    /*      */   public static void afterAttack(MapleCharacter player, MapleMonster monster, MapleStatEffect attackeffect, int mobCount, int attackCount, int skillid, boolean isCritDamage) {
        /*      */     int amon;
        /*      */     Integer value;
        /* 2181 */     PlayerStats stats = player.getStat();
        /* 2182 */     PlayerSpecialStats specialStats = player.getSpecialStat();
        /* 2183 */     int job = player.getJob();
        /* 2185 */     if (stats.hpRecoverProp > 0 && Randomizer.nextInt(100) <= stats.hpRecoverProp) {
            /* 2186 */       if (stats.hpRecover > 0)
                /* 2187 */         player.healHP(stats.hpRecover);
            /* 2190 */       if (stats.hpRecover_Percent > 0)
                /* 2192 */         player.addHP((int)(stats.getCurrentMaxHp() * stats.hpRecover_Percent / 100.0D) * mobCount);
            /*      */     }
        /* 2196 */     if (stats.mpRecoverProp > 0 && !JobConstants.isNotMpJob(job) && Randomizer.nextInt(100) <= stats.mpRecoverProp &&
                /* 2197 */       stats.mpRecover > 0)
            /* 2198 */       player.healMP(stats.mpRecover);
        /* 2202 */     switch (job) {
            /*      */       case 422:
                /* 2205 */         if (isCritDamage && player.getSkillLevel(4221054) > 0)
                    /* 2206 */           player.switchLuckyMoney(true);
                /*      */         break;
            /*      */       case 510:
                /*      */       case 511:
                /*      */       case 512:
                /* 2214 */         if (!specialStats.isEnergyFull() && skillid != 400051015) {
                    /* 2216 */           player.handleEnergyCharge(true);
                    /*      */           break;
                    /*      */         }
                /* 2219 */         player.handleEnergyConsume(mobCount, skillid);
                /*      */         break;
            /*      */       case 1212:
                /* 2223 */         if (player.getBuffedValue(MapleBuffStat.炎术引燃) != null) {
                    /* 2224 */           MapleStatEffect effect = player.getStatForBuff(MapleBuffStat.炎术引燃);
                    /* 2225 */           int crit = player.getBuffedIntValue(MapleBuffStat.炎术引燃);
                    /* 2228 */           crit++;
                    /* 2229 */           if (crit < 6 && crit > 6)
                        /* 2230 */             crit = 6;
                    /* 2234 */           Map<MapleBuffStat, Integer> stat = Collections.singletonMap(MapleBuffStat.炎术引燃, Integer.valueOf(crit));
                    /* 2235 */           player.setBuffedValue(MapleBuffStat.炎术引燃, crit);
                    /* 2236 */           int duration = effect.getDuration();
                    /* 2237 */           duration += (int)(player.getBuffedStartTime(MapleBuffStat.炎术引燃).longValue() - System.currentTimeMillis());
                    /* 2238 */           player.getClient().announce(BuffPacket.giveBuff(effect.getSourceid(), duration, stat, effect, player));
                    /*      */           break;
                    /*      */         }
                /* 2239 */         if (skillid == 400021042);
                /*      */         break;
            /*      */       case 110:
                /*      */       case 111:
                /*      */       case 112:
                /*      */       case 2411:
                /*      */       case 2412:
                /* 2249 */         if ((((skillid == 1121008 || skillid == 1120017) ? 1 : 0) & ((player.getBuffedValue(MapleBuffStat.斗争本能) != null) ? 1 : 0)) != 0) {
                    /* 2250 */           player.send(MaplePacketCreator.userBonusAttackRequest(400011074, 0, Collections.emptyList()));
                    /* 2251 */           player.send(MaplePacketCreator.userBonusAttackRequest(400011075, 0, Collections.emptyList()));
                    /* 2252 */           player.send(MaplePacketCreator.userBonusAttackRequest(400011076, 0, Collections.emptyList()));
                    /*      */         }
                /* 2255 */         if ((((skillid != 400011074) ? 1 : 0) & ((skillid != 400011075) ? 1 : 0) & ((skillid != 400011076) ? 1 : 0) & ((skillid != 1111008) ? 1 : 0) & ((player.getBuffedValue(MapleBuffStat.斗气集中) != null) ? 1 : 0)) != 0)
                    /* 2256 */           player.handleOrbgain(false);
                /*      */         break;
            /*      */       case 6100:
                /*      */       case 6110:
                /*      */       case 6111:
                /*      */       case 6112:
                /* 2263 */         amon = 0;
                /* 2264 */         switch (skillid) {
                    /*      */           case 61111100:
                        /*      */           case 61111111:
                        /* 2267 */             amon = 1;
                        /*      */             break;
                    /*      */           case 61001005:
                        /*      */           case 61001101:
                        /* 2271 */             amon = 2;
                        /*      */             break;
                    /*      */           case 61101100:
                        /*      */           case 61101101:
                        /* 2275 */             amon = 3;
                        /*      */             break;
                    /*      */           case 61111101:
                        /*      */           case 61121100:
                        /*      */           case 61121102:
                        /*      */           case 61121104:
                        /* 2281 */             amon = 5;
                        /*      */             break;
                    /*      */           case 61101002:
                        /*      */           case 61120007:
                        /* 2285 */             amon = 20;
                        /*      */             break;
                    /*      */           case 61121105:
                        /* 2288 */             amon = 40;
                        /*      */             break;
                    /*      */         }
                /* 2291 */         if (amon > 0)
                    /* 2292 */           player.handleMorphCharge(amon);
                /*      */         break;
            /*      */       case 312:
                /* 2296 */         if (player.getBuffSource(MapleBuffStat.IndieSummoned) == 400031002)
                    /* 2297 */           Optional.<Skill>ofNullable(SkillFactory.getSkill(400031002)).ifPresent(skill -> {
                        /*      */                 int totalSkillLevel = player.getTotalSkillLevel(400031002);
                        /*      */                 MapleStatEffect effect = skill.getEffect(totalSkillLevel);
                        /*      */                 if (totalSkillLevel > 0 && effect != null && JobConstants.is神射手(skillid / 10000) && System.currentTimeMillis() >= player.getLastUseVSkillTime()) {
                            /*      */                   player.setLastUseVSkillTime(System.currentTimeMillis() + (effect.getX() * 1000));
                            /*      */                   player.send(MaplePacketCreator.userBonusAttackRequest(400030002, 0, Collections.emptyList()));
                            /*      */                 }
                        /*      */               });
                /*      */         break;
            /*      */       case 1112:
                /* 2309 */         if (player.getBuffSource(MapleBuffStat.IndieSummoned) == 400011005)
                    /* 2310 */           Optional.<Skill>ofNullable(SkillFactory.getSkill(400011005)).ifPresent(skill -> {
                        /*      */                 int totalSkillLevel = player.getTotalSkillLevel(400011005);
                        /*      */                 MapleStatEffect effect = skill.getEffect(totalSkillLevel);
                        /*      */                 int value1 = player.getBuffedIntValue(MapleBuffStat.月光转换);
                        /*      */                 if (totalSkillLevel > 0 && effect != null && JobConstants.is魂骑士(skillid / 10000) && System.currentTimeMillis() >= player.getLastUseVSkillTime()) {
                            /*      */                   player.setLastUseVSkillTime(System.currentTimeMillis() + (effect.getS2() * 1000));
                            /*      */                   player.send(MaplePacketCreator.userBonusAttackRequest((value1 == 1) ? 400011022 : 400011023, 1, Collections.emptyList()));
                            /*      */                 }
                        /*      */               });
                /* 2320 */         if (attackeffect != null && attackeffect.getSourceid() == 400011056) {
                    /* 2321 */           MapleSummon summonBySkillID = player.getSummonBySkillID(400011065);
                    /* 2322 */           if (summonBySkillID != null) {
                        /* 2323 */             Rectangle a = MapleStatEffectFactory.calculateBoundingBox(attackeffect, player.getPosition(), player.isFacingLeft(), 500);
                        /* 2324 */             if (summonBySkillID.getBounds().contains(a) || summonBySkillID.getBounds().intersects(a)) {
                            /* 2325 */               summonBySkillID.setCharge(summonBySkillID.getCharge() + 1);
                            /* 2326 */               MapleMap map = player.getMap();
                            /* 2327 */               map.broadcastMessage(player, SummonPacket.SummonedCrossTheStyx(summonBySkillID, 1), true);
                            /*      */             }
                        /*      */             return;
                        /*      */           }
                    /* 2331 */           player.getSkillEffect(400011065).applyTo(player, new Point((player.getPosition()).x + (player.isFacingLeft() ? -100 : 100), (player.getPosition()).y));
                    /*      */         }
                /*      */         break;
            /*      */       case 2112:
                /* 2336 */         if (player.getBuffSource(MapleBuffStat.SECONDARY_STAT_BlessingArmorIncPAD) == 400011016)
                    /* 2337 */           Optional.<Skill>ofNullable(SkillFactory.getSkill(400011016)).ifPresent(skill -> {
                        /*      */                 int totalSkillLevel = player.getTotalSkillLevel(400011016);
                        /*      */                 MapleStatEffect effect = skill.getEffect(totalSkillLevel);
                        /*      */                 if (totalSkillLevel > 0 && effect != null && JobConstants.is战神(skillid / 10000) && System.currentTimeMillis() >= player.getLastUseVSkillTime()) {
                            /*      */                   player.setLastUseVSkillTime(System.currentTimeMillis() + (effect.getX() * 1000));
                            /*      */                   player.send(MaplePacketCreator.userBonusAttackRequest(400011020, 0, Collections.emptyList()));
                            /*      */                 }
                        /*      */               });
                /*      */         break;
            /*      */       case 2312:
                if (player.getBuffSource(MapleBuffStat.IndieSummoned) == 400031007) {
                    Optional.ofNullable(SkillFactory.getSkill(400031011)).ifPresent((skillx) -> {
                        int totalSkillLevel = player.getTotalSkillLevel(400031007);
                        MapleStatEffect effect = skillx.getEffect(totalSkillLevel);
                        if (totalSkillLevel > 0 && effect != null && (JobConstants.is双弩精灵(skillid / 10000) || skillid == 400031024 || skillid == 400031017) && System.currentTimeMillis() >= player.getLastUseVSkillTime()) {
                            Optional.ofNullable(SkillFactory.getSkill(400031007)).ifPresent((skill1) -> {
                                player.setLastUseVSkillTime(player.isSuperGM() ? 0L : System.currentTimeMillis() + (long)(skill1.getEffect(totalSkillLevel).getS2() * 1000));
                                player.send(MaplePacketCreator.userBonusAttackRequest(400031011, 0, Collections.emptyList()));
                            });
                        }

                    });
                }
                break;

            /*      */       case 6500:
                /*      */       case 6510:
                /*      */       case 6511:
                /*      */       case 6512:
                /* 2390 */         if (skillid == 400051011) {
                    /*      */           Skill skill;
                    /*      */           MapleStatEffect effect;
                    /* 2393 */           if ((skill = SkillFactory.getSkill(400051011)) != null && (
                            /* 2394 */             effect = skill.getEffect(player.getTotalSkillLevel(skill))) != null) {
                        /* 2395 */             player.cancelEffectFromBuffStat(MapleBuffStat.爱星能量);
                        /* 2396 */             player.handle无敌(effect, effect.getZ());
                        /*      */           }
                    /*      */         }
                /*      */         break;
            /*      */       case 522:
                /* 2402 */         value = player.getBuffedValue(MapleBuffStat.神速衔接);
                /* 2403 */         if (value == null) {
                    /* 2404 */           int skilllevel = player.getTotalSkillLevel(5221021);
                    /* 2405 */           Optional.<Skill>ofNullable(SkillFactory.getSkill(5221021)).ifPresent(skill -> {
                        /*      */                 MapleStatEffect effect = skill.getEffect(skilllevel);
                        /*      */                 if (Randomizer.nextInt(100) < effect.getProp())
                            /*      */                   effect.applyTo(player);
                        /*      */               });
                    /*      */           break;
                    /*      */         }
                /* 2411 */         if (value.intValue() > 1)
                    /* 2412 */           player.cancelBuffStats(new MapleBuffStat[] { MapleBuffStat.神速衔接 });
                /*      */         break;
            /*      */       case 15500:
                /*      */       case 15510:
                /*      */       case 15511:
                /*      */       case 15512:
                /* 2420 */         if (player.getBuffedValue(MapleBuffStat.追魂手) != null && player.getBuffedValue(MapleBuffStat.幽灵侵蚀) != null)
                    /* 2421 */           player.handle追魂手();
                /* 2423 */         player.handle念珠(skillid);
                /*      */         break;
            /*      */       case 1500:
                /*      */       case 1510:
                /*      */       case 1511:
                /*      */       case 1512:
                /* 2430 */         if (skillid != 400051044 && skillid != 400051045)
                    /* 2431 */           player.handle雷神长枪();
                /*      */         break;
            /*      */       case 4002:
                /*      */       case 4200:
                /*      */       case 4211:
                /*      */       case 4212:
                /* 2440 */         if (skillid == 42101005 &&
                        /* 2441 */           Randomizer.nextInt(100) < 50)
                    /* 2442 */           monster.getMap().spawnMist(new MapleMist(MapleStatEffectFactory.calculateBoundingBox(attackeffect, monster.getTruePosition(), player.isFacingLeft()), player, attackeffect, monster.getPosition()), attackeffect.getDuration(), false);
                /* 2446 */         if (player.getSkillLevel(42111002) > 0 && skillid != 42111002 && monster.getBeadJade() < (monster.isBoss() ? 15 : 10)) {
                    /* 2447 */           Skill skill = SkillFactory.getSkill(42111002);
                    /* 2448 */           if (skill.getEffect(player.getSkillLevel(skill)).makeChanceResult()) {
                        /* 2449 */             Item item = new Item(4033270, (short)0, (short)1);
                        /* 2450 */             monster.setBeadJade(Math.min(monster.isBoss() ? 15 : 10, monster.getBeadJade() + 1));
                        /* 2451 */             monster.getMap().spawnMobDrop(item, monster.getPosition(), monster, player, (byte)0, 0, 42111002);
                        /*      */           }
                    /*      */         }
                /* 2454 */         if (skillid == 42001000 || skillid == 42001005) {
                    /* 2455 */           MapleStatEffect skillEffect = player.getSkillEffect((skillid == 42001000) ? 42101004 : 42111006);
                    /* 2456 */           if (skillEffect != null)
                        /* 2457 */             skillEffect.applyMonsterBuff(player);
                    /*      */         }
                /* 2460 */         if (!monster.isAlive() && player.getSkillLevel(42110008) > 0)
                    /* 2461 */           player.getSkillEffect(42110008).applyTo(player);
                /* 2463 */         if (skillid == 42111002)
                    /* 2464 */           monster.getMap().removeDrop(4033270);
                /*      */         break;
            /*      */       case 301:
                /*      */       case 330:
                /*      */       case 331:
                /*      */       case 332:
                /* 2472 */         switch (skillid) {
                    /*      */           case 3301003:
                        /*      */           case 3301004:
                        /*      */           case 3310001:
                        /*      */           case 3311002:
                        /*      */           case 3311003:
                        /*      */           case 3311013:
                        /*      */           case 3321004:
                        /*      */           case 3321005:
                        /*      */           case 3321006:
                        /*      */           case 3321007:
                        /*      */           case 400031036:
                        /* 2484 */             player.addForceCon((player.getJob() == 332) ? 20 : 10, true);
                        /*      */             break;
                    /*      */         }
                /*      */         break;
            /*      */       case 16400:
                /*      */       case 16410:
                /*      */       case 16411:
                /*      */       case 16412:
                /* 2493 */         UpdateGage(player, skillid);
                /*      */         break;
            /*      */       default:
                /* 2507 */         if (JobConstants.is尖兵(job)) {
                    /* 2508 */           if (player.getBuffedValue(MapleBuffStat.精准火箭) != null)
                        /* 2509 */             player.handleCardStack(skillid);
                    /*      */           break;
                    /*      */         }
                /* 2511 */         if (JobConstants.is风灵使者(job)) {
                    /* 2512 */           if (player.getBuffedValue(MapleBuffStat.狂风肆虐) != null)
                        /* 2513 */             player.handle狂风肆虐(skillid);
                    /* 2515 */           if (skillid != 13100027 && skillid != 13110027 && skillid != 13120010)
                        /* 2516 */             player.handle暴风灭世(monster.getObjectId());
                    /* 2519 */           if (player.getBuffedValue(MapleBuffStat.风墙) != null) {
                        /* 2520 */             switch (skillid) {
                            /*      */               case 13100027:
                                /*      */               case 13101022:
                                /*      */               case 13110022:
                                /*      */               case 13110027:
                                /*      */               case 13111020:
                                /*      */               case 13120003:
                                /*      */               case 13120010:
                                /*      */               case 13121054:
                                /*      */                 return;
                            /*      */             }
                        /* 2532 */             if (skillid != 400031031 && System.currentTimeMillis() >= player.getLastUseVSkillTime()) {
                            /* 2533 */               player.setLastUseVSkillTime(System.currentTimeMillis() + 2000L);
                            /* 2534 */               Optional.<Skill>ofNullable(SkillFactory.getSkill(400031031)).ifPresent(skill -> {
                                /*      */                     MapleStatEffect effect = skill.getEffect(player.getTotalSkillLevel(skill));
                                /*      */                     Rectangle rectangle = MapleStatEffectFactory.calculateBoundingBox(effect, player.getOldPosition(), player.isFacingLeft());
                                /*      */                     List<MapleMapObject> mapObjectsInRect = player.getMap().getMapObjectsInRect(rectangle, Collections.singletonList(MapleMapObjectType.MONSTER));
                                /*      */                     ArrayList<Integer> arrayList = new ArrayList<>();
                                /*      */                     int i = 0;
                                /*      */                     for (MapleMapObject mmo : mapObjectsInRect) {
                                    /*      */                       if (i == 3)
                                        /*      */                         break;
                                    /*      */                       i++;
                                    /*      */                       arrayList.add(Integer.valueOf(mmo.getObjectId()));
                                    /*      */                     }
                                /*      */                     if (!arrayList.isEmpty())
                                    /*      */                       player.send_other(MaplePacketCreator.WindWall(player, arrayList), true);
                                /*      */                   });
                            /*      */             }
                        /*      */           }
                    /*      */           break;
                    /*      */         }
                /* 2553 */         if (JobConstants.is夜光(job)) {
                    /* 2554 */           player.handleLuminous(skillid);
                    /* 2555 */           if (player.getJob() == 2712)
                        /* 2556 */             player.handleDarkCrescendo();
                    /* 2558 */           player.handleBlackBless();
                    /*      */         }
                /*      */         break;
            /*      */     }
        /* 2581 */     if (JobConstants.is战士(player.getJob()) && player.getBuffedIntValue(MapleBuffStat.IndieSummoned) > 0 && player.getBuffSource(MapleBuffStat.IndieSummoned) == 400011000)
            /* 2582 */       Optional.<Skill>ofNullable(SkillFactory.getSkill(400011000)).ifPresent(skill -> {
                /*      */             int totalSkillLevel = player.getTotalSkillLevel(400011000);
                /*      */             MapleStatEffect effect = skill.getEffect(totalSkillLevel);
                /*      */             if (totalSkillLevel > 0 && effect != null && System.currentTimeMillis() >= player.getLastUseVSkillTime()) {
                    /*      */               player.setLastUseVSkillTime(System.currentTimeMillis() + (effect.getZ() * 1000));
                    /*      */               player.send(MaplePacketCreator.userBonusAttackRequest(400010000, 0, Collections.emptyList()));
                    /*      */             }
                /*      */           });
        /* 2591 */     if (skillid == 400031010 && JobConstants.is箭神(player.getJob()) && player.getBuffSource(MapleBuffStat.SECONDARY_STAT_CursorSniping) == 400031006) {
            /* 2592 */       int i = Math.max(0, player.getBuffedIntValue(MapleBuffStat.SECONDARY_STAT_CursorSniping) - 1);
            /* 2593 */       if (i > 0) {
                /* 2594 */         player.setBuffedValue(MapleBuffStat.SECONDARY_STAT_CursorSniping, i);
                /* 2595 */         player.updateBuffEffect(player.getStatForBuff(MapleBuffStat.SECONDARY_STAT_CursorSniping), Collections.singletonMap(MapleBuffStat.SECONDARY_STAT_CursorSniping, Integer.valueOf(i)));
                /*      */       } else {
                /* 2597 */         Optional.<Skill>ofNullable(SkillFactory.getSkill(400031006)).ifPresent(skill -> {
                    /*      */               MapleStatEffect effect = skill.getEffect(player.getTotalSkillLevel(400031006));
                    /*      */               player.cancelEffectFromBuffStat(MapleBuffStat.SECONDARY_STAT_CursorSniping);
                    /*      */               player.handle无敌(effect, 2000);
                    /*      */             });
                /*      */       }
            /*      */     }
        /*      */   }
    /*      */
    /*      */   public static void UpdateGage(MapleCharacter player, int skillid) {
        /* 2607 */     if (skillid == 164001000 || skillid == 164121003 || skillid == 164101000 || skillid == 164111003 || skillid == 164111000 || skillid == 164121000) {
            /* 2608 */       int Point = player.isSuperGM() ? 100 : 10;
            /* 2609 */       MapleStatEffect skilleffect = player.getSkillEffect(164000010);
            /* 2610 */       if (skilleffect != null)
                /* 2611 */         switch (skillid) {
                    /*      */           case 164001000:
                        /*      */           case 164121003:
                        /* 2614 */             if (player.getAttributeMan() == 1) {
                            /* 2615 */               Point = skilleffect.getU();
                            /*      */               break;
                            /*      */             }
                        /* 2617 */             switch (player.getSpecialStat().getTolAttribute()) {
                            /*      */               case 0:
                                /* 2619 */                 Point = skilleffect.getU();
                                /*      */                 break;
                            /*      */               case 1:
                                /* 2622 */                 Point = skilleffect.getV();
                                /*      */                 break;
                            /*      */               case 2:
                                /* 2625 */                 Point = skilleffect.getW();
                                /*      */                 break;
                            /*      */             }
                        /*      */             break;
                    /*      */           case 164101000:
                        /*      */           case 164111003:
                        /* 2632 */             if (player.getAttributeLand() == 1) {
                            /* 2633 */               Point = skilleffect.getU();
                            /*      */               break;
                            /*      */             }
                        /* 2635 */             switch (player.getSpecialStat().getTolAttribute()) {
                            /*      */               case 0:
                                /* 2637 */                 Point = skilleffect.getU();
                                /*      */                 break;
                            /*      */               case 1:
                                /* 2640 */                 Point = skilleffect.getV();
                                /*      */                 break;
                            /*      */               case 2:
                                /* 2643 */                 Point = skilleffect.getW();
                                /*      */                 break;
                            /*      */             }
                        /*      */             break;
                    /*      */           case 164111000:
                        /*      */           case 164121000:
                        /* 2650 */             if (player.getAttributeDay() == 1) {
                            /* 2651 */               Point = skilleffect.getU();
                            /*      */               break;
                            /*      */             }
                        /* 2653 */             switch (player.getSpecialStat().getTolAttribute()) {
                            /*      */               case 0:
                                /* 2655 */                 Point = skilleffect.getU();
                                /*      */                 break;
                            /*      */               case 1:
                                /* 2658 */                 Point = skilleffect.getV();
                                /*      */                 break;
                            /*      */               case 2:
                                /* 2661 */                 Point = skilleffect.getW();
                                /*      */                 break;
                            /*      */             }
                        /*      */             break;
                    /*      */         }
            /* 2668 */       if (player.getRunePoint() < 100)
                /* 2669 */         player.gainRunePoint(player.isSuperGM() ? 100 : Point);
            /* 2671 */       player.UpdateTaoism(skillid);
            /*      */     }
        /*      */   }
    /*      */
    /*      */   public static void handleKillMobs(MapleCharacter player, int kill, int moboid, int mobexp) {
        /* 2679 */     int mobKills = player.getMobKills();
        /* 2680 */     long lastMobKillTime = player.getLastMobKillTime();
        /* 2682 */     if (lastMobKillTime <= 0L || lastMobKillTime + 20000L < System.currentTimeMillis()) {
            /* 2683 */       mobKills = 0;
            /* 2684 */       player.setMobKills(mobKills);
            /*      */     }
        /* 2688 */     if (kill >= 3) {
            /* 2689 */       int totalexp = (int)(mobexp / 100.0D * kill);
            /* 2690 */       totalexp = (totalexp < 1) ? 1 : totalexp;
            /* 2691 */       player.gainExp(totalexp, false, false, false);
            /* 2692 */       player.getClient().announce(MaplePacketCreator.showContinuityKill(true, totalexp, kill, moboid));
            /*      */     }
        /* 2694 */     mobKills += kill;
        /* 2695 */     if (mobKills > 1) {
            /* 2696 */       int totalexp = (int)(mobexp / 1000.0D * ((mobKills >= 300) ? 'Ĭ' : mobKills));
            /* 2697 */       totalexp = (totalexp < 1) ? 1 : totalexp;
            /* 2698 */       player.gainExp(totalexp, false, false, false);
            /* 2699 */       player.getClient().announce(MaplePacketCreator.showContinuityKill(false, totalexp, mobKills, moboid));
            /*      */     }
        /* 2701 */     lastMobKillTime = System.currentTimeMillis();
        /* 2702 */     player.gainMobKills(mobKills);
        /* 2703 */     player.setLastMobKillTime(lastMobKillTime);
        /* 2705 */     Integer buffedValue = player.getBuffedValue(MapleBuffStat.重生契约);
        /* 2706 */     if (buffedValue != null)
            /* 2707 */       player.setBuffedValue(MapleBuffStat.重生契约, buffedValue.intValue() + kill);
        /*      */   }
    /*      */
    /*      */   public static void afterKillMonster(MapleCharacter player, MapleMonster monster, int skillID) {
        /* 2712 */     if (JobConstants.is剑豪(player.getJob())) {
            /* 2713 */       player.getSpecialStat().gainHayatoPoint(player.hasBuffSkill(40011288) ? 2 : 1);
            /* 2714 */       player.getClient().announce(MaplePacketCreator.updateJianQi(player.getSpecialStat().getHayatoPoint()));
            /* 2715 */     } else if (JobConstants.is林之灵(player.getJob())) {
            /* 2716 */       if (player.hasBuffSkill(112101016))
                /* 2717 */         Optional.<Skill>ofNullable(SkillFactory.getSkill(112101016)).ifPresent(skill -> {
                    /*      */               MapleStatEffect effect = skill.getEffect(player.getTotalSkillLevel(112101016));
                    /*      */               if (effect.makeChanceResult())
                        /*      */                 effect.applySummonEffect(player, false, monster.getTruePosition(), effect.getX(), 0);
                    /*      */             });
            /* 2724 */     } else if (!JobConstants.is火毒(player.getJob())) {
            /* 2732 */       if (JobConstants.is龙神(player.getJob())) {
                /*      */         MapleStatEffect effect;
                /* 2733 */         switch (skillID) {
                    /*      */           case 22110013:
                        /*      */           case 22110014:
                        /*      */           case 22110024:
                        /*      */           case 22110025:
                        /*      */           case 22140013:
                        /*      */           case 22140014:
                        /*      */           case 22140015:
                        /*      */           case 22140023:
                        /*      */           case 22140024:
                        /*      */           case 22141012:
                        /*      */           case 22170064:
                        /*      */           case 22170065:
                        /*      */           case 22170066:
                        /*      */           case 22170067:
                        /*      */           case 22170093:
                        /*      */           case 22170094:
                        /* 2750 */             effect = player.getSkillEffect(22141017);
                        /* 2751 */             if (player.getSkillEffect(22170070) != null)
                            /* 2752 */               effect = player.getSkillEffect(22170070);
                        /* 2754 */             if (effect != null && player.getEvanWreckages().size() < effect.getX())
                            /* 2755 */               player.getMap().broadcastMessage(player, MaplePacketCreator.addWreckage(player.getId(), monster.getPosition(), effect.getDuration() / 1000, player.addWreckages(new Point(monster.getPosition()), effect.getDuration()), effect.getSourceid(), 1, player.getEvanWreckages().size()), true);
                        /*      */             break;
                    /*      */         }
                /*      */       }
            /*      */     }
        /*      */   }
    /*      */
    /*      */   public static void AttackEffect(MapleCharacter player, MapleStatEffect attackeffect, int mobCount, int attackCount, int skillid) {
        /* 2765 */     int job = player.getJob();
        /* 2766 */     if (JobConstants.is古迹猎人(player.getJob())) {
            /* 2768 */       player.handle追加释魂(skillid);
            /* 2769 */       switch (skillid) {
                /*      */         case 3301003:
                    /*      */         case 3301004:
                    /*      */         case 3310001:
                    /*      */         case 3311013:
                    /*      */         case 3321004:
                    /*      */         case 3321005:
                    /*      */         case 3321014:
                    /*      */         case 3321015:
                    /*      */         case 3321016:
                    /*      */         case 3321017:
                    /*      */         case 3321018:
                    /*      */         case 3321019:
                    /*      */         case 3321020:
                    /*      */         case 3321021:
                    /* 2785 */           player.handle更新纹样(skillid);
                    /*      */           break;
                /*      */       }
            /*      */     }
        /*      */   }
    /*      */
    /*      */   public static void exterSkillAttack(MapleCharacter player, int skillid) {
        ArrayList arrayList = new ArrayList();
        Skill skill = SkillFactory.getSkill(skillid);
        List pairList = skill.getExtraSkillInfo();
        Optional.ofNullable(skill.getExtraSkillInfo()).ifPresent((pairs) -> {
            pairs.parallelStream().forEach((pairsExtraSkill) -> {
                if (skillid == (Integer)pairsExtraSkill.left) {
                    arrayList.add(pairsExtraSkill.right);
                }

            });
        });
        if (arrayList.size() > 0) {
            player.send(MaplePacketCreator.RegisterExtraSkill(player, skillid, arrayList));
        }

        /*      */   }
    /*      */
    /*      */   public static void handle封魔葫芦符(MapleCharacter player, MapleMonster monster, int skillid) {
        /* 2814 */     if (!monster.getStats().isBoss() && skillid == 164001001) {
            /* 2815 */       int moboid = monster.getObjectId();
            /* 2816 */       player.getSpecialStat().gainForceCounter();
            /* 2817 */       player.setXSmobOID(moboid);
            /* 2819 */       player.getMap().broadcastMessage(ForcePacket.Show封魔葫芦符(player.getId(), moboid, player.getSpecialStat().getForceCounter(), skillid), player.getTruePosition());
            /* 2820 */       player.getClient().announce(MobPacket.killMonster(monster.getObjectId(), 1));
            /*      */     }
        /* 2823 */     if (skillid == 164001002)
            /* 2824 */       Optional.<Skill>ofNullable(SkillFactory.getSkill(164001002)).ifPresent(skill -> {
                /*      */             int totalSkillLevel = player.getTotalSkillLevel(164001002);
                /*      */             MapleStatEffect effect = skill.getEffect(totalSkillLevel);
                /*      */             if (totalSkillLevel > 0 && effect != null) {
                    /*      */               MapleMonster monster2 = player.getMap().getMonsterByOid(player.getXSmobOID());
                    /*      */               if (monster2 != null) {
                        /*      */                 monster2.damage(player, monster2.getStats().isBoss() ? 1L : monster2.getHp(), true, 164001001);
                        /*      */                 player.getClient().announce(EffectPacket.showXSSkillEffect(null, skillid, player.getLevel(), monster2.getObjectId(), monster2.getId(), effect.getLevel()));
                        /*      */                 player.getMap().broadcastMessage(player, EffectPacket.showXSSkillEffect(player, skillid, player.getLevel(), monster2.getObjectId(), monster2.getId(), effect.getLevel()), false);
                        /*      */               }
                    /*      */               player.setXSmobOID(0);
                    /*      */             }
                /*      */           });
        /*      */   }
    /*      */
    /*      */   public static void handle幻影分身符(MapleCharacter player, int skillid) {
        /* 2843 */     if (player.hasBuffSkill(164101003)) {
            /*      */       MapleStatEffect skillEffect;
            /* 2845 */       if ((skillEffect = player.getSkillEffect(164101004)) != null && skillid != 164101004 &&
                    /* 2846 */         System.currentTimeMillis() >= player.getLastUseSkillTime()) {
                /* 2848 */         List<MapleMapObject> mapObjectsInRect = player.getMap().getMonstersInRange(player.getPosition(), 100000.0D);
                /* 2851 */         ArrayList<Integer> mobs = new ArrayList<>();
                /* 2852 */         mapObjectsInRect.forEach(mob -> mobs.add(Integer.valueOf(mob.getObjectId())));
                /* 2854 */         if (!mobs.isEmpty()) {
                    /* 2855 */           MapleForceAtom forceAtom = MapleForceAtomFactory.INSTANCE.createForceAtom(player, skillEffect, mobs);
                    /* 2856 */           player.getMap().broadcastMessage(player, forceAtom.getPacket(), true);
                    /* 2858 */           player.setLastUseSkillTime(System.currentTimeMillis() + 1500L);
                    /*      */         }
                /*      */       }
            /*      */     }
        /*      */   }
    /*      */
    /*      */   public static void handle地震碎_地(MapleCharacter player, MapleMonster monster, int skillid) {
        /* 2866 */     if (skillid == 164111003) {
            /*      */       MapleStatEffect skillEffect;
            /* 2868 */       if ((skillEffect = player.getSkillEffect(164111003)) != null && !monster.isBuffed(MonsterStatus.MOB_STAT_Stun) && !monster.isBoss())
                /* 2870 */         monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Stun, Integer.valueOf(1), skillEffect.getSourceid(), null, false, 0), false, skillEffect.getDuration(), true, skillEffect);
            /*      */     }
        /*      */   }
    /*      */
    /*      */   public static void handle卷术蝶梦(MapleCharacter player, int skillid) {
        /* 2876 */     if (player.hasBuffSkill(164121007)) {
            /*      */       MapleStatEffect skillEffect;
            /* 2878 */       if (System.currentTimeMillis() >= player.getLastUseSkillTime() && (
                    /* 2879 */         skillEffect = player.getSkillEffect(164121007)) != null && skillid != 164120007 && skillid != 80001770) {
                /* 2880 */         player.getSpecialStat().gainForceCounter();
                /* 2881 */         player.getMap().broadcastMessage(player, ForcePacket.show卷术蝶梦(player.getId(), player.getSpecialStat().getForceCounter(), skillEffect.getU2(), player.getPosition()), true);
                /* 2882 */         player.getSpecialStat().gainForceCounter(1);
                /* 2884 */         player.setLastUseSkillTime(System.currentTimeMillis() + (skillEffect.getX() * 1000));
                /*      */       }
            /*      */     }
        /*      */   }
    /*      */
    /*      */   public static void handle卷术微生强变(MapleCharacter player, MapleMonster monster, int skillid) {
        /* 2892 */     if (skillid == 164111008) {
            /*      */       MapleStatEffect skillEffect;
            /* 2894 */       if ((skillEffect = player.getSkillEffect(164111008)) != null && !monster.isBoss()) {
                /* 2896 */         List<MonsterStatusEffect> arrayList = new ArrayList<>();
                /* 2897 */         arrayList.add(new MonsterStatusEffect(MonsterStatus.MOB_STAT_PAD, Integer.valueOf(skillEffect.getX()), skillEffect.getSourceid(), null, false));
                /* 2898 */         int[] skills = { skillEffect.getU(), skillEffect.getV(), skillEffect.getW(), skillEffect.getU2() };
                /* 2899 */         arrayList.add(new MonsterStatusEffect(MonsterStatus.怪物状态_卷术_微生强变, Integer.valueOf(skills[Randomizer.nextInt(skills.length)]), skillEffect.getSourceid(), null, false));
                /* 2900 */         monster.applyStatus(player, arrayList, false, (skillEffect.getSubTime() * 1000), true, skillEffect);
                /*      */       }
            /*      */     }
        /*      */   }
    /*      */ }

